Skip to content

Commit

Permalink
refactor: window上暴露sessionId,以便与别的系统交互
Browse files Browse the repository at this point in the history
  • Loading branch information
Chryseis committed Jan 26, 2022
1 parent 0d44852 commit 957d4b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/web-performance/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class WebVitals implements IWebVitals {
this.immediately = immediately

const sessionId = generateUniqueID()
window.__monitor_sessionId__ = sessionId
reporter = createReporter(sessionId, appId, version, reportCallback)
metricsStore = new MetricsStore()

Expand Down
1 change: 1 addition & 0 deletions packages/web-performance/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@ declare global {
// Build flags:
__monitor_xhr__: boolean
__monitor_fetch__: boolean
__monitor_sessionId__: string
}
}

0 comments on commit 957d4b4

Please sign in to comment.