@sentry/browser 10.53.0 → 10.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/dev/client.js +15 -54
- package/build/npm/cjs/dev/client.js.map +1 -1
- package/build/npm/cjs/dev/debug-build.js +0 -5
- package/build/npm/cjs/dev/debug-build.js.map +1 -1
- package/build/npm/cjs/dev/diagnose-sdk.js +15 -37
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/dev/eventbuilder.js +59 -217
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
- package/build/npm/cjs/dev/feedbackAsync.js +1 -5
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/dev/feedbackSync.js +1 -2
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
- package/build/npm/cjs/dev/helpers.js +24 -102
- package/build/npm/cjs/dev/helpers.js.map +1 -1
- package/build/npm/cjs/dev/index.js +2 -0
- package/build/npm/cjs/dev/index.js.map +1 -1
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browsersession.js +7 -35
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/dev/integrations/contextlines.js +9 -45
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/dev/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpclient.js +43 -203
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spotlight.js +17 -30
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/dev/integrations/webWorker.js +40 -211
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/dev/profiling/index.js +9 -30
- package/build/npm/cjs/dev/profiling/index.js.map +1 -1
- package/build/npm/cjs/dev/profiling/integration.js +30 -64
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/dev/profiling/utils.js +131 -398
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
- package/build/npm/cjs/dev/report-dialog.js +10 -25
- package/build/npm/cjs/dev/report-dialog.js.map +1 -1
- package/build/npm/cjs/dev/sdk.js +8 -76
- package/build/npm/cjs/dev/sdk.js.map +1 -1
- package/build/npm/cjs/dev/stack-parsers.js +42 -126
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
- package/build/npm/cjs/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/dev/tracing/request.js +58 -223
- package/build/npm/cjs/dev/tracing/request.js.map +1 -1
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/dev/tracing/utils.js +4 -27
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -1
- package/build/npm/cjs/dev/transports/fetch.js +10 -23
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
- package/build/npm/cjs/dev/transports/offline.js +27 -84
- package/build/npm/cjs/dev/transports/offline.js.map +1 -1
- package/build/npm/cjs/dev/userfeedback.js +12 -22
- package/build/npm/cjs/dev/userfeedback.js.map +1 -1
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/cjs/prod/client.js +15 -54
- package/build/npm/cjs/prod/client.js.map +1 -1
- package/build/npm/cjs/prod/debug-build.js +0 -5
- package/build/npm/cjs/prod/debug-build.js.map +1 -1
- package/build/npm/cjs/prod/diagnose-sdk.js +15 -37
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/prod/eventbuilder.js +59 -217
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
- package/build/npm/cjs/prod/feedbackAsync.js +1 -5
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/prod/feedbackSync.js +1 -2
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
- package/build/npm/cjs/prod/helpers.js +24 -102
- package/build/npm/cjs/prod/helpers.js.map +1 -1
- package/build/npm/cjs/prod/index.js +2 -0
- package/build/npm/cjs/prod/index.js.map +1 -1
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browsersession.js +7 -35
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/prod/integrations/contextlines.js +9 -45
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/prod/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpclient.js +43 -203
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spotlight.js +17 -30
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/prod/integrations/webWorker.js +40 -211
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/prod/profiling/index.js +9 -30
- package/build/npm/cjs/prod/profiling/index.js.map +1 -1
- package/build/npm/cjs/prod/profiling/integration.js +30 -64
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/prod/profiling/utils.js +131 -398
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
- package/build/npm/cjs/prod/report-dialog.js +10 -25
- package/build/npm/cjs/prod/report-dialog.js.map +1 -1
- package/build/npm/cjs/prod/sdk.js +5 -73
- package/build/npm/cjs/prod/sdk.js.map +1 -1
- package/build/npm/cjs/prod/stack-parsers.js +42 -126
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
- package/build/npm/cjs/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/prod/tracing/request.js +58 -223
- package/build/npm/cjs/prod/tracing/request.js.map +1 -1
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/prod/tracing/utils.js +4 -27
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -1
- package/build/npm/cjs/prod/transports/fetch.js +10 -23
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
- package/build/npm/cjs/prod/transports/offline.js +27 -84
- package/build/npm/cjs/prod/transports/offline.js.map +1 -1
- package/build/npm/cjs/prod/userfeedback.js +12 -22
- package/build/npm/cjs/prod/userfeedback.js.map +1 -1
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/dev/client.js +15 -54
- package/build/npm/esm/dev/client.js.map +1 -1
- package/build/npm/esm/dev/debug-build.js +0 -5
- package/build/npm/esm/dev/debug-build.js.map +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js +15 -37
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/dev/eventbuilder.js +59 -217
- package/build/npm/esm/dev/eventbuilder.js.map +1 -1
- package/build/npm/esm/dev/feedbackAsync.js +1 -5
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
- package/build/npm/esm/dev/feedbackSync.js +1 -2
- package/build/npm/esm/dev/feedbackSync.js.map +1 -1
- package/build/npm/esm/dev/helpers.js +24 -102
- package/build/npm/esm/dev/helpers.js.map +1 -1
- package/build/npm/esm/dev/index.js +1 -0
- package/build/npm/esm/dev/index.js.map +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js +7 -35
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js +9 -45
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js +11 -36
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js +43 -203
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js +7 -17
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js +7 -15
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js +17 -30
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js +40 -211
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/dev/package.json +1 -1
- package/build/npm/esm/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/dev/profiling/index.js +9 -30
- package/build/npm/esm/dev/profiling/index.js.map +1 -1
- package/build/npm/esm/dev/profiling/integration.js +30 -64
- package/build/npm/esm/dev/profiling/integration.js.map +1 -1
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/dev/profiling/utils.js +131 -398
- package/build/npm/esm/dev/profiling/utils.js.map +1 -1
- package/build/npm/esm/dev/report-dialog.js +10 -25
- package/build/npm/esm/dev/report-dialog.js.map +1 -1
- package/build/npm/esm/dev/sdk.js +8 -76
- package/build/npm/esm/dev/sdk.js.map +1 -1
- package/build/npm/esm/dev/stack-parsers.js +42 -126
- package/build/npm/esm/dev/stack-parsers.js.map +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/dev/tracing/request.js +59 -224
- package/build/npm/esm/dev/tracing/request.js.map +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/dev/tracing/utils.js +4 -27
- package/build/npm/esm/dev/tracing/utils.js.map +1 -1
- package/build/npm/esm/dev/transports/fetch.js +10 -23
- package/build/npm/esm/dev/transports/fetch.js.map +1 -1
- package/build/npm/esm/dev/transports/offline.js +27 -84
- package/build/npm/esm/dev/transports/offline.js.map +1 -1
- package/build/npm/esm/dev/userfeedback.js +12 -22
- package/build/npm/esm/dev/userfeedback.js.map +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/prod/client.js +15 -54
- package/build/npm/esm/prod/client.js.map +1 -1
- package/build/npm/esm/prod/debug-build.js +0 -5
- package/build/npm/esm/prod/debug-build.js.map +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js +15 -37
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/prod/eventbuilder.js +59 -217
- package/build/npm/esm/prod/eventbuilder.js.map +1 -1
- package/build/npm/esm/prod/feedbackAsync.js +1 -5
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
- package/build/npm/esm/prod/feedbackSync.js +1 -2
- package/build/npm/esm/prod/feedbackSync.js.map +1 -1
- package/build/npm/esm/prod/helpers.js +24 -102
- package/build/npm/esm/prod/helpers.js.map +1 -1
- package/build/npm/esm/prod/index.js +1 -0
- package/build/npm/esm/prod/index.js.map +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js +7 -35
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js +9 -45
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js +11 -36
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js +43 -203
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js +7 -17
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js +7 -15
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js +17 -30
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js +40 -211
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/prod/package.json +1 -1
- package/build/npm/esm/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/prod/profiling/index.js +9 -30
- package/build/npm/esm/prod/profiling/index.js.map +1 -1
- package/build/npm/esm/prod/profiling/integration.js +30 -64
- package/build/npm/esm/prod/profiling/integration.js.map +1 -1
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/prod/profiling/utils.js +131 -398
- package/build/npm/esm/prod/profiling/utils.js.map +1 -1
- package/build/npm/esm/prod/report-dialog.js +10 -25
- package/build/npm/esm/prod/report-dialog.js.map +1 -1
- package/build/npm/esm/prod/sdk.js +5 -73
- package/build/npm/esm/prod/sdk.js.map +1 -1
- package/build/npm/esm/prod/stack-parsers.js +42 -126
- package/build/npm/esm/prod/stack-parsers.js.map +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/prod/tracing/request.js +59 -224
- package/build/npm/esm/prod/tracing/request.js.map +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/prod/tracing/utils.js +4 -27
- package/build/npm/esm/prod/tracing/utils.js.map +1 -1
- package/build/npm/esm/prod/transports/fetch.js +10 -23
- package/build/npm/esm/prod/transports/fetch.js.map +1 -1
- package/build/npm/esm/prod/transports/offline.js +27 -84
- package/build/npm/esm/prod/transports/offline.js.map +1 -1
- package/build/npm/esm/prod/userfeedback.js +12 -22
- package/build/npm/esm/prod/userfeedback.js.map +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/eventbuilder.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.bundle.d.ts +2 -2
- package/build/npm/types/index.bundle.d.ts.map +1 -1
- package/build/npm/types/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +1 -0
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/request.d.ts +3 -0
- package/build/npm/types/tracing/request.d.ts.map +1 -1
- package/build/npm/types-ts3.8/index.bundle.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.d.ts +1 -0
- package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types-ts3.8/tracing/request.d.ts +3 -0
- package/package.json +7 -7
|
@@ -4,28 +4,20 @@ const browser = require('@sentry/core/browser');
|
|
|
4
4
|
const browserUtils = require('@sentry-internal/browser-utils');
|
|
5
5
|
const debugBuild = require('../debug-build.js');
|
|
6
6
|
const helpers = require('../helpers.js');
|
|
7
|
+
const fetchStreamPerformance = require('../integrations/fetchStreamPerformance.js');
|
|
7
8
|
const backgroundtab = require('./backgroundtab.js');
|
|
8
9
|
const linkedTraces = require('./linkedTraces.js');
|
|
9
10
|
const request = require('./request.js');
|
|
10
11
|
|
|
11
|
-
const BROWSER_TRACING_INTEGRATION_ID =
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* We don't want to start a bunch of idle timers and PerformanceObservers
|
|
15
|
-
* for web crawlers, as they may prevent the page from being seen as "idle"
|
|
16
|
-
* by the crawler's rendering engine (e.g. Googlebot's headless Chromium).
|
|
17
|
-
*/
|
|
18
|
-
const BOT_USER_AGENT_RE =
|
|
19
|
-
/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
|
|
20
|
-
|
|
12
|
+
const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing";
|
|
13
|
+
const BOT_USER_AGENT_RE = /Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
|
|
21
14
|
function isBotUserAgent() {
|
|
22
|
-
const nav = helpers.WINDOW.navigator
|
|
15
|
+
const nav = helpers.WINDOW.navigator;
|
|
23
16
|
if (!nav?.userAgent) {
|
|
24
17
|
return false;
|
|
25
18
|
}
|
|
26
19
|
return BOT_USER_AGENT_RE.test(nav.userAgent);
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
const DEFAULT_BROWSER_TRACING_OPTIONS = {
|
|
30
22
|
...browser.TRACING_DEFAULTS,
|
|
31
23
|
instrumentNavigation: true,
|
|
@@ -37,43 +29,25 @@ const DEFAULT_BROWSER_TRACING_OPTIONS = {
|
|
|
37
29
|
ignoreResourceSpans: [],
|
|
38
30
|
ignorePerformanceApiSpans: [],
|
|
39
31
|
detectRedirects: true,
|
|
40
|
-
linkPreviousTrace:
|
|
32
|
+
linkPreviousTrace: "in-memory",
|
|
41
33
|
consistentTraceSampling: false,
|
|
42
34
|
enableReportPageLoaded: false,
|
|
43
35
|
_experiments: {},
|
|
44
|
-
...request.defaultRequestInstrumentationOptions
|
|
36
|
+
...request.defaultRequestInstrumentationOptions
|
|
45
37
|
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The Browser Tracing integration automatically instruments browser pageload/navigation
|
|
49
|
-
* actions as transactions, and captures requests, metrics and errors as spans.
|
|
50
|
-
*
|
|
51
|
-
* The integration can be configured with a variety of options, and can be extended to use
|
|
52
|
-
* any routing library.
|
|
53
|
-
*
|
|
54
|
-
* We explicitly export the proper type here, as this has to be extended in some cases.
|
|
55
|
-
*/
|
|
56
38
|
const browserTracingIntegration = ((options = {}) => {
|
|
57
|
-
if (
|
|
39
|
+
if ("enableElementTiming" in options) {
|
|
58
40
|
browser.consoleSandbox(() => {
|
|
59
|
-
// oxlint-disable-next-line no-console
|
|
60
41
|
console.warn(
|
|
61
|
-
|
|
42
|
+
"[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead."
|
|
62
43
|
);
|
|
63
44
|
});
|
|
64
45
|
}
|
|
65
|
-
|
|
66
46
|
const latestRoute = {
|
|
67
|
-
name:
|
|
68
|
-
source:
|
|
47
|
+
name: void 0,
|
|
48
|
+
source: void 0
|
|
69
49
|
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* This is just a small wrapper that makes `document` optional.
|
|
73
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
74
|
-
*/
|
|
75
|
-
const optionalWindowDocument = helpers.WINDOW.document ;
|
|
76
|
-
|
|
50
|
+
const optionalWindowDocument = helpers.WINDOW.document;
|
|
77
51
|
const {
|
|
78
52
|
enableInp,
|
|
79
53
|
enableLongTask,
|
|
@@ -98,59 +72,41 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
98
72
|
consistentTraceSampling,
|
|
99
73
|
enableReportPageLoaded,
|
|
100
74
|
onRequestSpanStart,
|
|
101
|
-
onRequestSpanEnd
|
|
75
|
+
onRequestSpanEnd
|
|
102
76
|
} = {
|
|
103
77
|
...DEFAULT_BROWSER_TRACING_OPTIONS,
|
|
104
|
-
...options
|
|
78
|
+
...options
|
|
105
79
|
};
|
|
106
|
-
|
|
107
80
|
const _isBot = isBotUserAgent();
|
|
108
|
-
|
|
109
81
|
let _collectWebVitals;
|
|
110
82
|
let lastInteractionTimestamp;
|
|
111
|
-
|
|
112
83
|
let _pageloadSpan;
|
|
113
|
-
|
|
114
|
-
/** Create routing idle transaction. */
|
|
115
84
|
function _createRouteSpan(client, startSpanOptions, makeActive = true) {
|
|
116
|
-
const isPageloadSpan = startSpanOptions.op ===
|
|
117
|
-
|
|
85
|
+
const isPageloadSpan = startSpanOptions.op === "pageload";
|
|
118
86
|
const initialSpanName = startSpanOptions.name;
|
|
119
|
-
const finalStartSpanOptions = beforeStartSpan
|
|
120
|
-
? beforeStartSpan(startSpanOptions)
|
|
121
|
-
: startSpanOptions;
|
|
122
|
-
|
|
87
|
+
const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions;
|
|
123
88
|
const attributes = finalStartSpanOptions.attributes || {};
|
|
124
|
-
|
|
125
|
-
// If `finalStartSpanOptions.name` is different than `startSpanOptions.name`
|
|
126
|
-
// it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.
|
|
127
89
|
if (initialSpanName !== finalStartSpanOptions.name) {
|
|
128
|
-
attributes[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] =
|
|
90
|
+
attributes[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom";
|
|
129
91
|
finalStartSpanOptions.attributes = attributes;
|
|
130
92
|
}
|
|
131
|
-
|
|
132
93
|
if (!makeActive) {
|
|
133
|
-
// We want to ensure this has 0s duration
|
|
134
94
|
const now = browser.dateTimestampInSeconds();
|
|
135
95
|
browser.startInactiveSpan({
|
|
136
96
|
...finalStartSpanOptions,
|
|
137
|
-
startTime: now
|
|
97
|
+
startTime: now
|
|
138
98
|
}).end(now);
|
|
139
99
|
return;
|
|
140
100
|
}
|
|
141
|
-
|
|
142
101
|
latestRoute.name = finalStartSpanOptions.name;
|
|
143
102
|
latestRoute.source = attributes[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
|
|
144
|
-
|
|
145
103
|
const idleSpan = browser.startIdleSpan(finalStartSpanOptions, {
|
|
146
104
|
idleTimeout,
|
|
147
105
|
finalTimeout,
|
|
148
106
|
childSpanTimeout,
|
|
149
107
|
// should wait for finish signal if it's a pageload transaction
|
|
150
108
|
disableAutoFinish: isPageloadSpan,
|
|
151
|
-
beforeSpanEnd: span => {
|
|
152
|
-
// This will generally always be defined here, because it is set in `setup()` of the integration
|
|
153
|
-
// but technically, it is optional, so we guard here to be extra safe
|
|
109
|
+
beforeSpanEnd: (span) => {
|
|
154
110
|
_collectWebVitals?.();
|
|
155
111
|
const spanStreamingEnabled = browser.hasSpanStreamingEnabled(client);
|
|
156
112
|
browserUtils.addPerformanceEntries(span, {
|
|
@@ -158,71 +114,53 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
158
114
|
recordLcpOnPageloadSpan: !spanStreamingEnabled && !enableStandaloneLcpSpans,
|
|
159
115
|
ignoreResourceSpans,
|
|
160
116
|
ignorePerformanceApiSpans,
|
|
161
|
-
spanStreamingEnabled
|
|
117
|
+
spanStreamingEnabled
|
|
162
118
|
});
|
|
163
|
-
setActiveIdleSpan(client,
|
|
164
|
-
|
|
165
|
-
// A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.
|
|
166
|
-
// Only when another navigation happens, we want to create a new trace.
|
|
167
|
-
// This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.
|
|
119
|
+
setActiveIdleSpan(client, void 0);
|
|
168
120
|
const scope = browser.getCurrentScope();
|
|
169
121
|
const oldPropagationContext = scope.getPropagationContext();
|
|
170
|
-
|
|
171
122
|
scope.setPropagationContext({
|
|
172
123
|
...oldPropagationContext,
|
|
173
124
|
traceId: idleSpan.spanContext().traceId,
|
|
174
125
|
sampled: browser.spanIsSampled(idleSpan),
|
|
175
|
-
dsc: browser.getDynamicSamplingContextFromSpan(span)
|
|
126
|
+
dsc: browser.getDynamicSamplingContextFromSpan(span)
|
|
176
127
|
});
|
|
177
|
-
|
|
178
128
|
if (isPageloadSpan) {
|
|
179
|
-
|
|
180
|
-
_pageloadSpan = undefined;
|
|
129
|
+
_pageloadSpan = void 0;
|
|
181
130
|
}
|
|
182
131
|
},
|
|
183
|
-
trimIdleSpanEndTimestamp: !enableReportPageLoaded
|
|
132
|
+
trimIdleSpanEndTimestamp: !enableReportPageLoaded
|
|
184
133
|
});
|
|
185
|
-
|
|
186
134
|
if (isPageloadSpan && enableReportPageLoaded) {
|
|
187
135
|
_pageloadSpan = idleSpan;
|
|
188
136
|
}
|
|
189
|
-
|
|
190
137
|
setActiveIdleSpan(client, idleSpan);
|
|
191
|
-
|
|
192
138
|
function emitFinish() {
|
|
193
|
-
if (optionalWindowDocument && [
|
|
194
|
-
client.emit(
|
|
139
|
+
if (optionalWindowDocument && ["interactive", "complete"].includes(optionalWindowDocument.readyState)) {
|
|
140
|
+
client.emit("idleSpanEnableAutoFinish", idleSpan);
|
|
195
141
|
}
|
|
196
142
|
}
|
|
197
|
-
|
|
198
|
-
// Enable auto finish of the pageload span if users are not explicitly ending it
|
|
199
143
|
if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {
|
|
200
|
-
optionalWindowDocument.addEventListener(
|
|
144
|
+
optionalWindowDocument.addEventListener("readystatechange", () => {
|
|
201
145
|
emitFinish();
|
|
202
146
|
});
|
|
203
|
-
|
|
204
147
|
emitFinish();
|
|
205
148
|
}
|
|
206
149
|
}
|
|
207
|
-
|
|
208
150
|
return {
|
|
209
151
|
name: BROWSER_TRACING_INTEGRATION_ID,
|
|
210
152
|
setup(client) {
|
|
211
153
|
if (_isBot) {
|
|
212
|
-
debugBuild.DEBUG_BUILD && browser.debug.log(
|
|
154
|
+
debugBuild.DEBUG_BUILD && browser.debug.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");
|
|
213
155
|
return;
|
|
214
156
|
}
|
|
215
|
-
|
|
216
157
|
browser.registerSpanErrorInstrumentation();
|
|
217
|
-
|
|
218
158
|
const spanStreamingEnabled = browser.hasSpanStreamingEnabled(client);
|
|
219
|
-
|
|
220
159
|
_collectWebVitals = browserUtils.startTrackingWebVitals({
|
|
221
|
-
recordClsStandaloneSpans: spanStreamingEnabled ?
|
|
222
|
-
recordLcpStandaloneSpans: spanStreamingEnabled ?
|
|
223
|
-
client
|
|
160
|
+
recordClsStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneClsSpans || false,
|
|
161
|
+
recordLcpStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneLcpSpans || false,
|
|
162
|
+
client
|
|
224
163
|
});
|
|
225
|
-
|
|
226
164
|
if (spanStreamingEnabled) {
|
|
227
165
|
browserUtils.trackLcpAsSpan(client);
|
|
228
166
|
browserUtils.trackClsAsSpan(client);
|
|
@@ -232,387 +170,260 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
232
170
|
} else if (enableInp) {
|
|
233
171
|
browserUtils.startTrackingINP();
|
|
234
172
|
}
|
|
235
|
-
|
|
236
|
-
if (
|
|
237
|
-
enableLongAnimationFrame &&
|
|
238
|
-
browser.GLOBAL_OBJ.PerformanceObserver &&
|
|
239
|
-
PerformanceObserver.supportedEntryTypes?.includes('long-animation-frame')
|
|
240
|
-
) {
|
|
173
|
+
if (enableLongAnimationFrame && browser.GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")) {
|
|
241
174
|
browserUtils.startTrackingLongAnimationFrames();
|
|
242
175
|
} else if (enableLongTask) {
|
|
243
176
|
browserUtils.startTrackingLongTasks();
|
|
244
177
|
}
|
|
245
|
-
|
|
246
178
|
if (enableInteractions) {
|
|
247
179
|
browserUtils.startTrackingInteractions();
|
|
248
180
|
}
|
|
249
|
-
|
|
250
181
|
if (detectRedirects && optionalWindowDocument) {
|
|
251
182
|
const interactionHandler = () => {
|
|
252
183
|
lastInteractionTimestamp = browser.timestampInSeconds();
|
|
253
184
|
};
|
|
254
|
-
addEventListener(
|
|
255
|
-
addEventListener(
|
|
185
|
+
addEventListener("click", interactionHandler, { capture: true });
|
|
186
|
+
addEventListener("keydown", interactionHandler, { capture: true, passive: true });
|
|
256
187
|
}
|
|
257
|
-
|
|
258
188
|
function maybeEndActiveSpan() {
|
|
259
189
|
const activeSpan = getActiveIdleSpan(client);
|
|
260
|
-
|
|
261
190
|
if (activeSpan && !browser.spanToJSON(activeSpan).timestamp) {
|
|
262
191
|
debugBuild.DEBUG_BUILD && browser.debug.log(`[Tracing] Finishing current active span with op: ${browser.spanToJSON(activeSpan).op}`);
|
|
263
|
-
|
|
264
|
-
activeSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');
|
|
192
|
+
activeSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "cancelled");
|
|
265
193
|
activeSpan.end();
|
|
266
194
|
}
|
|
267
195
|
}
|
|
268
|
-
|
|
269
|
-
client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {
|
|
196
|
+
client.on("startNavigationSpan", (startSpanOptions, navigationOptions) => {
|
|
270
197
|
if (browser.getClient() !== client) {
|
|
271
198
|
return;
|
|
272
199
|
}
|
|
273
|
-
|
|
274
200
|
if (navigationOptions?.isRedirect) {
|
|
275
|
-
debugBuild.DEBUG_BUILD &&
|
|
276
|
-
browser.debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');
|
|
201
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span.");
|
|
277
202
|
_createRouteSpan(
|
|
278
203
|
client,
|
|
279
204
|
{
|
|
280
|
-
op:
|
|
281
|
-
...startSpanOptions
|
|
205
|
+
op: "navigation.redirect",
|
|
206
|
+
...startSpanOptions
|
|
282
207
|
},
|
|
283
|
-
false
|
|
208
|
+
false
|
|
284
209
|
);
|
|
285
210
|
return;
|
|
286
211
|
}
|
|
287
|
-
|
|
288
|
-
// Reset the last interaction timestamp since we now start a new navigation.
|
|
289
|
-
// Any subsequent navigation span starts could again be a redirect, so we
|
|
290
|
-
// should reset our heuristic detectors.
|
|
291
|
-
lastInteractionTimestamp = undefined;
|
|
292
|
-
|
|
212
|
+
lastInteractionTimestamp = void 0;
|
|
293
213
|
maybeEndActiveSpan();
|
|
294
|
-
|
|
295
214
|
browser.getIsolationScope().setPropagationContext({
|
|
296
215
|
traceId: browser.generateTraceId(),
|
|
297
216
|
sampleRand: Math.random(),
|
|
298
|
-
propagationSpanId: browser.hasSpansEnabled() ?
|
|
217
|
+
propagationSpanId: browser.hasSpansEnabled() ? void 0 : browser.generateSpanId()
|
|
299
218
|
});
|
|
300
|
-
|
|
301
219
|
const scope = browser.getCurrentScope();
|
|
302
220
|
scope.setPropagationContext({
|
|
303
221
|
traceId: browser.generateTraceId(),
|
|
304
222
|
sampleRand: Math.random(),
|
|
305
|
-
propagationSpanId: browser.hasSpansEnabled() ?
|
|
223
|
+
propagationSpanId: browser.hasSpansEnabled() ? void 0 : browser.generateSpanId()
|
|
306
224
|
});
|
|
307
|
-
|
|
308
|
-
// We reset this to ensure we do not have lingering incorrect data here
|
|
309
|
-
// places that call this hook may set this where appropriate - else, the URL at span sending time is used
|
|
310
225
|
scope.setSDKProcessingMetadata({
|
|
311
|
-
normalizedRequest:
|
|
226
|
+
normalizedRequest: void 0
|
|
312
227
|
});
|
|
313
|
-
|
|
314
228
|
_createRouteSpan(client, {
|
|
315
|
-
op:
|
|
229
|
+
op: "navigation",
|
|
316
230
|
...startSpanOptions,
|
|
317
231
|
// Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)
|
|
318
232
|
parentSpan: null,
|
|
319
|
-
forceTransaction: true
|
|
233
|
+
forceTransaction: true
|
|
320
234
|
});
|
|
321
235
|
});
|
|
322
|
-
|
|
323
|
-
client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {
|
|
236
|
+
client.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => {
|
|
324
237
|
if (browser.getClient() !== client) {
|
|
325
238
|
return;
|
|
326
239
|
}
|
|
327
240
|
maybeEndActiveSpan();
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');
|
|
331
|
-
const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');
|
|
332
|
-
|
|
241
|
+
const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace") || getServerTiming("sentry-trace");
|
|
242
|
+
const baggage = traceOptions.baggage || getMetaContent("baggage") || getServerTiming("baggage");
|
|
333
243
|
const propagationContext = browser.propagationContextFromHeaders(sentryTrace, baggage);
|
|
334
|
-
|
|
335
244
|
const scope = browser.getCurrentScope();
|
|
336
245
|
scope.setPropagationContext(propagationContext);
|
|
337
246
|
if (!browser.hasSpansEnabled()) {
|
|
338
|
-
// for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace
|
|
339
|
-
// this works by setting the propagationSpanId to a random spanId so that we have a consistent
|
|
340
|
-
// span id to propagate in TwP mode (!hasSpansEnabled())
|
|
341
247
|
scope.getPropagationContext().propagationSpanId = browser.generateSpanId();
|
|
342
248
|
}
|
|
343
|
-
|
|
344
|
-
// We store the normalized request data on the scope, so we get the request data at time of span creation
|
|
345
|
-
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
|
|
346
249
|
scope.setSDKProcessingMetadata({
|
|
347
|
-
normalizedRequest: helpers.getHttpRequestData()
|
|
250
|
+
normalizedRequest: helpers.getHttpRequestData()
|
|
348
251
|
});
|
|
349
|
-
|
|
350
252
|
_createRouteSpan(client, {
|
|
351
|
-
op:
|
|
352
|
-
...startSpanOptions
|
|
253
|
+
op: "pageload",
|
|
254
|
+
...startSpanOptions
|
|
353
255
|
});
|
|
354
256
|
});
|
|
355
|
-
|
|
356
|
-
client.on('endPageloadSpan', () => {
|
|
257
|
+
client.on("endPageloadSpan", () => {
|
|
357
258
|
if (enableReportPageLoaded && _pageloadSpan) {
|
|
358
|
-
_pageloadSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,
|
|
259
|
+
_pageloadSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "reportPageLoaded");
|
|
359
260
|
_pageloadSpan.end();
|
|
360
261
|
}
|
|
361
262
|
});
|
|
362
263
|
},
|
|
363
|
-
|
|
364
264
|
afterAllSetup(client) {
|
|
365
265
|
if (_isBot) {
|
|
366
266
|
return;
|
|
367
267
|
}
|
|
368
|
-
|
|
369
268
|
let startingUrl = browser.getLocationHref();
|
|
370
|
-
|
|
371
|
-
if (linkPreviousTrace !== 'off') {
|
|
269
|
+
if (linkPreviousTrace !== "off") {
|
|
372
270
|
linkedTraces.linkTraces(client, { linkPreviousTrace, consistentTraceSampling });
|
|
373
271
|
}
|
|
374
|
-
|
|
375
272
|
if (helpers.WINDOW.location) {
|
|
376
273
|
if (instrumentPageLoad) {
|
|
377
274
|
const origin = browser.browserPerformanceTimeOrigin();
|
|
378
275
|
startBrowserTracingPageLoadSpan(client, {
|
|
379
276
|
name: helpers.WINDOW.location.pathname,
|
|
380
277
|
// pageload should always start at timeOrigin (and needs to be in s, not ms)
|
|
381
|
-
startTime: origin ? origin /
|
|
278
|
+
startTime: origin ? origin / 1e3 : void 0,
|
|
382
279
|
attributes: {
|
|
383
|
-
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:
|
|
384
|
-
[browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:
|
|
385
|
-
}
|
|
280
|
+
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
|
|
281
|
+
[browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser"
|
|
282
|
+
}
|
|
386
283
|
});
|
|
387
284
|
}
|
|
388
|
-
|
|
389
285
|
if (instrumentNavigation) {
|
|
390
286
|
browserUtils.addHistoryInstrumentationHandler(({ to, from }) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
|
|
394
|
-
* create an uneccessary navigation transaction.
|
|
395
|
-
*
|
|
396
|
-
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
|
|
397
|
-
* only be caused in certain development environments where the usage of a hot module reloader is causing
|
|
398
|
-
* errors.
|
|
399
|
-
*/
|
|
400
|
-
if (from === undefined && startingUrl?.indexOf(to) !== -1) {
|
|
401
|
-
startingUrl = undefined;
|
|
287
|
+
if (from === void 0 && startingUrl?.indexOf(to) !== -1) {
|
|
288
|
+
startingUrl = void 0;
|
|
402
289
|
return;
|
|
403
290
|
}
|
|
404
|
-
|
|
405
|
-
startingUrl = undefined;
|
|
291
|
+
startingUrl = void 0;
|
|
406
292
|
const parsed = browser.parseStringToURLObject(to);
|
|
407
293
|
const activeSpan = getActiveIdleSpan(client);
|
|
408
|
-
const navigationIsRedirect =
|
|
409
|
-
activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
|
|
410
|
-
|
|
294
|
+
const navigationIsRedirect = activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
|
|
411
295
|
startBrowserTracingNavigationSpan(
|
|
412
296
|
client,
|
|
413
297
|
{
|
|
414
298
|
name: parsed?.pathname || helpers.WINDOW.location.pathname,
|
|
415
299
|
attributes: {
|
|
416
|
-
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:
|
|
417
|
-
[browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:
|
|
418
|
-
}
|
|
300
|
+
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
|
|
301
|
+
[browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser"
|
|
302
|
+
}
|
|
419
303
|
},
|
|
420
|
-
{ url: to, isRedirect: navigationIsRedirect }
|
|
304
|
+
{ url: to, isRedirect: navigationIsRedirect }
|
|
421
305
|
);
|
|
422
306
|
});
|
|
423
307
|
}
|
|
424
308
|
}
|
|
425
|
-
|
|
426
309
|
if (markBackgroundSpan) {
|
|
427
310
|
backgroundtab.registerBackgroundTabDetection();
|
|
428
311
|
}
|
|
429
|
-
|
|
430
312
|
if (enableInteractions) {
|
|
431
313
|
registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute);
|
|
432
314
|
}
|
|
433
|
-
|
|
434
315
|
if (enableInp) {
|
|
435
316
|
browserUtils.registerInpInteractionListener();
|
|
436
317
|
}
|
|
437
|
-
|
|
438
318
|
request.instrumentOutgoingRequests(client, {
|
|
439
319
|
traceFetch,
|
|
440
320
|
traceXHR,
|
|
441
|
-
trackFetchStreamPerformance,
|
|
442
321
|
tracePropagationTargets: client.getOptions().tracePropagationTargets,
|
|
443
322
|
shouldCreateSpanForRequest,
|
|
444
323
|
enableHTTPTimings,
|
|
445
324
|
onRequestSpanStart,
|
|
446
|
-
onRequestSpanEnd
|
|
325
|
+
onRequestSpanEnd
|
|
447
326
|
});
|
|
448
|
-
|
|
327
|
+
if (trackFetchStreamPerformance) {
|
|
328
|
+
client.addIntegration(fetchStreamPerformance.fetchStreamPerformanceIntegration());
|
|
329
|
+
}
|
|
330
|
+
}
|
|
449
331
|
};
|
|
450
|
-
})
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
* Manually start a page load span.
|
|
454
|
-
* This will only do something if a browser tracing integration integration has been setup.
|
|
455
|
-
*
|
|
456
|
-
* If you provide a custom `traceOptions` object, it will be used to continue the trace
|
|
457
|
-
* instead of the default behavior, which is to look it up on the <meta> tags.
|
|
458
|
-
*/
|
|
459
|
-
function startBrowserTracingPageLoadSpan(
|
|
460
|
-
client,
|
|
461
|
-
spanOptions,
|
|
462
|
-
traceOptions,
|
|
463
|
-
) {
|
|
464
|
-
client.emit('startPageLoadSpan', spanOptions, traceOptions);
|
|
332
|
+
});
|
|
333
|
+
function startBrowserTracingPageLoadSpan(client, spanOptions, traceOptions) {
|
|
334
|
+
client.emit("startPageLoadSpan", spanOptions, traceOptions);
|
|
465
335
|
browser.getCurrentScope().setTransactionName(spanOptions.name);
|
|
466
|
-
|
|
467
336
|
const pageloadSpan = getActiveIdleSpan(client);
|
|
468
|
-
|
|
469
337
|
if (pageloadSpan) {
|
|
470
|
-
client.emit(
|
|
338
|
+
client.emit("afterStartPageLoadSpan", pageloadSpan);
|
|
471
339
|
}
|
|
472
|
-
|
|
473
340
|
return pageloadSpan;
|
|
474
341
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
*/
|
|
480
|
-
function startBrowserTracingNavigationSpan(
|
|
481
|
-
client,
|
|
482
|
-
spanOptions,
|
|
483
|
-
options,
|
|
484
|
-
) {
|
|
485
|
-
const { url, isRedirect } = options || {};
|
|
486
|
-
client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect });
|
|
487
|
-
client.emit('startNavigationSpan', spanOptions, { isRedirect });
|
|
488
|
-
|
|
342
|
+
function startBrowserTracingNavigationSpan(client, spanOptions, options) {
|
|
343
|
+
const { url, isRedirect: isRedirect2 } = options || {};
|
|
344
|
+
client.emit("beforeStartNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
|
|
345
|
+
client.emit("startNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
|
|
489
346
|
const scope = browser.getCurrentScope();
|
|
490
347
|
scope.setTransactionName(spanOptions.name);
|
|
491
|
-
|
|
492
|
-
// We store the normalized request data on the scope, so we get the request data at time of span creation
|
|
493
|
-
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
|
|
494
|
-
if (url && !isRedirect) {
|
|
348
|
+
if (url && !isRedirect2) {
|
|
495
349
|
scope.setSDKProcessingMetadata({
|
|
496
350
|
normalizedRequest: {
|
|
497
351
|
...helpers.getHttpRequestData(),
|
|
498
|
-
url
|
|
499
|
-
}
|
|
352
|
+
url
|
|
353
|
+
}
|
|
500
354
|
});
|
|
501
355
|
}
|
|
502
|
-
|
|
503
356
|
return getActiveIdleSpan(client);
|
|
504
357
|
}
|
|
505
|
-
|
|
506
|
-
/** Returns the value of a meta tag */
|
|
507
358
|
function getMetaContent(metaName) {
|
|
508
|
-
|
|
509
|
-
* This is just a small wrapper that makes `document` optional.
|
|
510
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
511
|
-
*/
|
|
512
|
-
const optionalWindowDocument = helpers.WINDOW.document ;
|
|
513
|
-
|
|
359
|
+
const optionalWindowDocument = helpers.WINDOW.document;
|
|
514
360
|
const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);
|
|
515
|
-
return metaTag?.getAttribute(
|
|
361
|
+
return metaTag?.getAttribute("content") || void 0;
|
|
516
362
|
}
|
|
517
|
-
|
|
518
|
-
/** Returns the description of a server timing entry */
|
|
519
363
|
function getServerTiming(name) {
|
|
520
|
-
const navigation = helpers.WINDOW.performance?.getEntriesByType?.(
|
|
521
|
-
const entry = navigation?.serverTiming?.find(
|
|
364
|
+
const navigation = helpers.WINDOW.performance?.getEntriesByType?.("navigation")[0];
|
|
365
|
+
const entry = navigation?.serverTiming?.find((entry2) => entry2.name === name);
|
|
522
366
|
return entry?.description;
|
|
523
367
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
function registerInteractionListener(
|
|
527
|
-
client,
|
|
528
|
-
idleTimeout,
|
|
529
|
-
finalTimeout,
|
|
530
|
-
childSpanTimeout,
|
|
531
|
-
latestRoute,
|
|
532
|
-
) {
|
|
533
|
-
/**
|
|
534
|
-
* This is just a small wrapper that makes `document` optional.
|
|
535
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
536
|
-
*/
|
|
537
|
-
const optionalWindowDocument = helpers.WINDOW.document ;
|
|
538
|
-
|
|
368
|
+
function registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute) {
|
|
369
|
+
const optionalWindowDocument = helpers.WINDOW.document;
|
|
539
370
|
let inflightInteractionSpan;
|
|
540
371
|
const registerInteractionTransaction = () => {
|
|
541
|
-
const op =
|
|
542
|
-
|
|
372
|
+
const op = "ui.action.click";
|
|
543
373
|
const activeIdleSpan = getActiveIdleSpan(client);
|
|
544
374
|
if (activeIdleSpan) {
|
|
545
375
|
const currentRootSpanOp = browser.spanToJSON(activeIdleSpan).op;
|
|
546
|
-
if ([
|
|
547
|
-
debugBuild.DEBUG_BUILD &&
|
|
548
|
-
|
|
549
|
-
return undefined;
|
|
376
|
+
if (["navigation", "pageload"].includes(currentRootSpanOp)) {
|
|
377
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);
|
|
378
|
+
return void 0;
|
|
550
379
|
}
|
|
551
380
|
}
|
|
552
|
-
|
|
553
381
|
if (inflightInteractionSpan) {
|
|
554
|
-
inflightInteractionSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,
|
|
382
|
+
inflightInteractionSpan.setAttribute(browser.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted");
|
|
555
383
|
inflightInteractionSpan.end();
|
|
556
|
-
inflightInteractionSpan =
|
|
384
|
+
inflightInteractionSpan = void 0;
|
|
557
385
|
}
|
|
558
|
-
|
|
559
386
|
if (!latestRoute.name) {
|
|
560
387
|
debugBuild.DEBUG_BUILD && browser.debug.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
|
|
561
|
-
return
|
|
388
|
+
return void 0;
|
|
562
389
|
}
|
|
563
|
-
|
|
564
390
|
inflightInteractionSpan = browser.startIdleSpan(
|
|
565
391
|
{
|
|
566
392
|
name: latestRoute.name,
|
|
567
393
|
op,
|
|
568
394
|
attributes: {
|
|
569
|
-
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source ||
|
|
570
|
-
}
|
|
395
|
+
[browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url"
|
|
396
|
+
}
|
|
571
397
|
},
|
|
572
398
|
{
|
|
573
399
|
idleTimeout,
|
|
574
400
|
finalTimeout,
|
|
575
|
-
childSpanTimeout
|
|
576
|
-
}
|
|
401
|
+
childSpanTimeout
|
|
402
|
+
}
|
|
577
403
|
);
|
|
578
404
|
};
|
|
579
|
-
|
|
580
405
|
if (optionalWindowDocument) {
|
|
581
|
-
addEventListener(
|
|
406
|
+
addEventListener("click", registerInteractionTransaction, { capture: true });
|
|
582
407
|
}
|
|
583
408
|
}
|
|
584
|
-
|
|
585
|
-
// We store the active idle span on the client object, so we can access it from exported functions
|
|
586
|
-
const ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';
|
|
409
|
+
const ACTIVE_IDLE_SPAN_PROPERTY = "_sentry_idleSpan";
|
|
587
410
|
function getActiveIdleSpan(client) {
|
|
588
|
-
return
|
|
411
|
+
return client[ACTIVE_IDLE_SPAN_PROPERTY];
|
|
589
412
|
}
|
|
590
|
-
|
|
591
413
|
function setActiveIdleSpan(client, span) {
|
|
592
414
|
browser.addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);
|
|
593
415
|
}
|
|
594
|
-
|
|
595
|
-
// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect
|
|
596
416
|
const REDIRECT_THRESHOLD = 1.5;
|
|
597
|
-
|
|
598
417
|
function isRedirect(activeSpan, lastInteractionTimestamp) {
|
|
599
418
|
const spanData = browser.spanToJSON(activeSpan);
|
|
600
|
-
|
|
601
419
|
const now = browser.dateTimestampInSeconds();
|
|
602
|
-
|
|
603
|
-
// More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?
|
|
604
|
-
// --> never consider this a redirect
|
|
605
420
|
const startTimestamp = spanData.start_timestamp;
|
|
606
421
|
if (now - startTimestamp > REDIRECT_THRESHOLD) {
|
|
607
422
|
return false;
|
|
608
423
|
}
|
|
609
|
-
|
|
610
|
-
// A click happened in the last REDIRECT_THRESHOLD seconds?
|
|
611
|
-
// --> never consider this a redirect
|
|
612
424
|
if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {
|
|
613
425
|
return false;
|
|
614
426
|
}
|
|
615
|
-
|
|
616
427
|
return true;
|
|
617
428
|
}
|
|
618
429
|
|