@sentry/browser 10.53.1 → 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
|
@@ -1,177 +1,99 @@
|
|
|
1
1
|
import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, withScope, addExceptionTypeValue, addExceptionMechanism, captureException, getLocationHref } from '@sentry/core/browser';
|
|
2
2
|
|
|
3
|
-
const WINDOW = GLOBAL_OBJ
|
|
4
|
-
|
|
3
|
+
const WINDOW = GLOBAL_OBJ;
|
|
5
4
|
let ignoreOnError = 0;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
5
|
function shouldIgnoreOnError() {
|
|
11
6
|
return ignoreOnError > 0;
|
|
12
7
|
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
8
|
function ignoreNextOnError() {
|
|
18
|
-
// onerror should trigger before setTimeout
|
|
19
9
|
ignoreOnError++;
|
|
20
10
|
setTimeout(() => {
|
|
21
11
|
ignoreOnError--;
|
|
22
12
|
});
|
|
23
13
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Instruments the given function and sends an event to Sentry every time the
|
|
29
|
-
* function throws an exception.
|
|
30
|
-
*
|
|
31
|
-
* @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
|
|
32
|
-
* has a correct `this` context.
|
|
33
|
-
* @returns The wrapped function.
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
function wrap(
|
|
37
|
-
fn,
|
|
38
|
-
options
|
|
39
|
-
|
|
40
|
-
= {},
|
|
41
|
-
) {
|
|
42
|
-
// for future readers what this does is wrap a function and then create
|
|
43
|
-
// a bi-directional wrapping between them.
|
|
44
|
-
//
|
|
45
|
-
// example: wrapped = wrap(original);
|
|
46
|
-
// original.__sentry_wrapped__ -> wrapped
|
|
47
|
-
// wrapped.__sentry_original__ -> original
|
|
48
|
-
|
|
49
|
-
function isFunction(fn) {
|
|
50
|
-
return typeof fn === 'function';
|
|
14
|
+
function wrap(fn, options = {}) {
|
|
15
|
+
function isFunction(fn2) {
|
|
16
|
+
return typeof fn2 === "function";
|
|
51
17
|
}
|
|
52
|
-
|
|
53
18
|
if (!isFunction(fn)) {
|
|
54
19
|
return fn;
|
|
55
20
|
}
|
|
56
|
-
|
|
57
21
|
try {
|
|
58
|
-
|
|
59
|
-
// the original wrapper.
|
|
60
|
-
const wrapper = (fn ).__sentry_wrapped__;
|
|
22
|
+
const wrapper = fn.__sentry_wrapped__;
|
|
61
23
|
if (wrapper) {
|
|
62
|
-
if (typeof wrapper ===
|
|
24
|
+
if (typeof wrapper === "function") {
|
|
63
25
|
return wrapper;
|
|
64
26
|
} else {
|
|
65
|
-
// If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means
|
|
66
|
-
// that something messed with it. In that case we want to return the originally passed function.
|
|
67
27
|
return fn;
|
|
68
28
|
}
|
|
69
29
|
}
|
|
70
|
-
|
|
71
|
-
// We don't wanna wrap it twice
|
|
72
30
|
if (getOriginalFunction(fn)) {
|
|
73
31
|
return fn;
|
|
74
32
|
}
|
|
75
33
|
} catch {
|
|
76
|
-
// Just accessing custom props in some Selenium environments
|
|
77
|
-
// can cause a "Permission denied" exception (see raven-js#495).
|
|
78
|
-
// Bail on wrapping and return the function as-is (defers to window.onerror).
|
|
79
34
|
return fn;
|
|
80
35
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
|
|
84
|
-
const sentryWrapped = function ( ...args) {
|
|
36
|
+
const sentryWrapped = function(...args) {
|
|
37
|
+
GLOBAL_OBJ._sentryWrappedDepth = (GLOBAL_OBJ._sentryWrappedDepth || 0) + 1;
|
|
85
38
|
try {
|
|
86
|
-
|
|
87
|
-
const wrappedArguments = args.map(arg => wrap(arg, options));
|
|
88
|
-
|
|
89
|
-
// Attempt to invoke user-land function
|
|
90
|
-
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
91
|
-
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
92
|
-
// is expected behavior and NOT indicative of a bug with sentry.javascript.
|
|
39
|
+
const wrappedArguments = args.map((arg) => wrap(arg, options));
|
|
93
40
|
return fn.apply(this, wrappedArguments);
|
|
94
41
|
} catch (ex) {
|
|
95
42
|
ignoreNextOnError();
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
scope.addEventProcessor(event => {
|
|
43
|
+
withScope((scope) => {
|
|
44
|
+
scope.addEventProcessor((event) => {
|
|
99
45
|
if (options.mechanism) {
|
|
100
|
-
addExceptionTypeValue(event,
|
|
46
|
+
addExceptionTypeValue(event, void 0, void 0);
|
|
101
47
|
addExceptionMechanism(event, options.mechanism);
|
|
102
48
|
}
|
|
103
|
-
|
|
104
49
|
event.extra = {
|
|
105
50
|
...event.extra,
|
|
106
|
-
arguments: args
|
|
51
|
+
arguments: args
|
|
107
52
|
};
|
|
108
|
-
|
|
109
53
|
return event;
|
|
110
54
|
});
|
|
111
|
-
|
|
112
|
-
// no need to add a mechanism here, we already add it via an event processor above
|
|
113
55
|
captureException(ex);
|
|
114
56
|
});
|
|
115
|
-
|
|
116
57
|
throw ex;
|
|
58
|
+
} finally {
|
|
59
|
+
GLOBAL_OBJ._sentryWrappedDepth = (GLOBAL_OBJ._sentryWrappedDepth || 0) - 1;
|
|
117
60
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available
|
|
61
|
+
};
|
|
121
62
|
try {
|
|
122
63
|
for (const property in fn) {
|
|
123
64
|
if (Object.prototype.hasOwnProperty.call(fn, property)) {
|
|
124
|
-
sentryWrapped[property
|
|
65
|
+
sentryWrapped[property] = fn[property];
|
|
125
66
|
}
|
|
126
67
|
}
|
|
127
68
|
} catch {
|
|
128
|
-
// Accessing some objects may throw
|
|
129
|
-
// ref: https://github.com/getsentry/sentry-javascript/issues/1168
|
|
130
69
|
}
|
|
131
|
-
|
|
132
|
-
// Signal that this function has been wrapped/filled already
|
|
133
|
-
// for both debugging and to prevent it to being wrapped/filled twice
|
|
134
70
|
markFunctionWrapped(sentryWrapped, fn);
|
|
135
|
-
|
|
136
|
-
addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
|
|
137
|
-
|
|
138
|
-
// Restore original function name (not all browsers allow that)
|
|
71
|
+
addNonEnumerableProperty(fn, "__sentry_wrapped__", sentryWrapped);
|
|
139
72
|
try {
|
|
140
|
-
|
|
141
|
-
const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
|
|
73
|
+
const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, "name");
|
|
142
74
|
if (descriptor.configurable) {
|
|
143
|
-
Object.defineProperty(sentryWrapped,
|
|
75
|
+
Object.defineProperty(sentryWrapped, "name", {
|
|
144
76
|
get() {
|
|
145
77
|
return fn.name;
|
|
146
|
-
}
|
|
78
|
+
}
|
|
147
79
|
});
|
|
148
80
|
}
|
|
149
81
|
} catch {
|
|
150
|
-
// This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.
|
|
151
|
-
// to save some bytes we simply try-catch this
|
|
152
82
|
}
|
|
153
|
-
|
|
154
83
|
return sentryWrapped;
|
|
155
84
|
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Get HTTP request data from the current page.
|
|
159
|
-
*/
|
|
160
85
|
function getHttpRequestData() {
|
|
161
|
-
// grab as much info as exists and add it to the event
|
|
162
86
|
const url = getLocationHref();
|
|
163
87
|
const { referrer } = WINDOW.document || {};
|
|
164
88
|
const { userAgent } = WINDOW.navigator || {};
|
|
165
|
-
|
|
166
89
|
const headers = {
|
|
167
|
-
...
|
|
168
|
-
...
|
|
90
|
+
...referrer && { Referer: referrer },
|
|
91
|
+
...userAgent && { "User-Agent": userAgent }
|
|
169
92
|
};
|
|
170
93
|
const request = {
|
|
171
94
|
url,
|
|
172
|
-
headers
|
|
95
|
+
headers
|
|
173
96
|
};
|
|
174
|
-
|
|
175
97
|
return request;
|
|
176
98
|
}
|
|
177
99
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/helpers.ts"],"sourcesContent":["import type { Mechanism, WrappedFunction } from '@sentry/core/browser';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n captureException,\n getLocationHref,\n getOriginalFunction,\n GLOBAL_OBJ,\n markFunctionWrapped,\n withScope,\n} from '@sentry/core/browser';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype WrappableFunction = Function;\n\nexport function wrap<T extends WrappableFunction>(\n fn: T,\n options?: {\n mechanism?: Mechanism;\n },\n): WrappedFunction<T>;\nexport function wrap<NonFunction>(\n fn: NonFunction,\n options?: {\n mechanism?: Mechanism;\n },\n): NonFunction;\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap<T extends WrappableFunction, NonFunction>(\n fn: T | NonFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n): NonFunction | WrappedFunction<T> {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n function isFunction(fn: T | NonFunction): fn is T {\n return typeof fn === 'function';\n }\n\n if (!isFunction(fn)) {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = (fn as WrappedFunction<T>).__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n // Wrap the function itself\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function (this: unknown, ...args: unknown[]): unknown {\n try {\n // Also wrap arguments that are themselves functions\n const wrappedArguments = args.map(arg => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n // no need to add a mechanism here, we already add it via an event processor above\n captureException(ex);\n });\n\n throw ex;\n }\n } as unknown as WrappedFunction<T>;\n\n // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property as keyof T] = fn[property as keyof T];\n }\n }\n } catch {\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n }\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name')!;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch {\n // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.\n // to save some bytes we simply try-catch this\n }\n\n return sentryWrapped;\n}\n\n/**\n * Get HTTP request data from the current page.\n */\nexport function getHttpRequestData(): { url: string; headers: Record<string, string> } {\n // grab as much info as exists and add it to the event\n const url = getLocationHref();\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = {\n url,\n headers,\n };\n\n return request;\n}\n"],"names":[],"mappings":";;AAaO,MAAM,MAAA,GAAS
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../src/helpers.ts"],"sourcesContent":["import type { Mechanism, WrappedFunction } from '@sentry/core/browser';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n captureException,\n getLocationHref,\n getOriginalFunction,\n GLOBAL_OBJ,\n markFunctionWrapped,\n withScope,\n} from '@sentry/core/browser';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype WrappableFunction = Function;\n\nexport function wrap<T extends WrappableFunction>(\n fn: T,\n options?: {\n mechanism?: Mechanism;\n },\n): WrappedFunction<T>;\nexport function wrap<NonFunction>(\n fn: NonFunction,\n options?: {\n mechanism?: Mechanism;\n },\n): NonFunction;\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap<T extends WrappableFunction, NonFunction>(\n fn: T | NonFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n): NonFunction | WrappedFunction<T> {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n function isFunction(fn: T | NonFunction): fn is T {\n return typeof fn === 'function';\n }\n\n if (!isFunction(fn)) {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = (fn as WrappedFunction<T>).__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n // Wrap the function itself\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function (this: unknown, ...args: unknown[]): unknown {\n // Track depth on GLOBAL_OBJ so the thirdPartyErrorFilterIntegration (in @sentry/core) can detect\n // that processEvent is running inside a sentryWrapped call, even with minified/bundled code.\n GLOBAL_OBJ._sentryWrappedDepth = (GLOBAL_OBJ._sentryWrappedDepth || 0) + 1;\n try {\n // Also wrap arguments that are themselves functions\n const wrappedArguments = args.map(arg => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n // no need to add a mechanism here, we already add it via an event processor above\n captureException(ex);\n });\n\n throw ex;\n } finally {\n GLOBAL_OBJ._sentryWrappedDepth = (GLOBAL_OBJ._sentryWrappedDepth || 0) - 1;\n }\n } as unknown as WrappedFunction<T>;\n\n // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property as keyof T] = fn[property as keyof T];\n }\n }\n } catch {\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n }\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name')!;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch {\n // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.\n // to save some bytes we simply try-catch this\n }\n\n return sentryWrapped;\n}\n\n/**\n * Get HTTP request data from the current page.\n */\nexport function getHttpRequestData(): { url: string; headers: Record<string, string> } {\n // grab as much info as exists and add it to the event\n const url = getLocationHref();\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = {\n url,\n headers,\n };\n\n return request;\n}\n"],"names":["fn"],"mappings":"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"}
|
|
@@ -31,6 +31,7 @@ export { elementTimingIntegration } from '@sentry-internal/browser-utils';
|
|
|
31
31
|
export { reportPageLoaded } from './tracing/reportPageLoaded.js';
|
|
32
32
|
export { setActiveSpanInBrowser } from './tracing/setActiveSpan.js';
|
|
33
33
|
export { spanStreamingIntegration } from './integrations/spanstreaming.js';
|
|
34
|
+
export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance.js';
|
|
34
35
|
export { makeBrowserOfflineTransport } from './transports/offline.js';
|
|
35
36
|
export { browserProfilingIntegration } from './profiling/integration.js';
|
|
36
37
|
export { spotlightBrowserIntegration } from './integrations/spotlight.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,11 +3,8 @@ import { addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, a
|
|
|
3
3
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
4
|
import { WINDOW } from '../helpers.js';
|
|
5
5
|
|
|
6
|
-
/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */
|
|
7
6
|
const MAX_ALLOWED_STRING_LENGTH = 1024;
|
|
8
|
-
|
|
9
|
-
const INTEGRATION_NAME = 'Breadcrumbs';
|
|
10
|
-
|
|
7
|
+
const INTEGRATION_NAME = "Breadcrumbs";
|
|
11
8
|
const _breadcrumbsIntegration = ((options = {}) => {
|
|
12
9
|
const _options = {
|
|
13
10
|
console: true,
|
|
@@ -16,13 +13,11 @@ const _breadcrumbsIntegration = ((options = {}) => {
|
|
|
16
13
|
history: true,
|
|
17
14
|
sentry: true,
|
|
18
15
|
xhr: true,
|
|
19
|
-
...options
|
|
16
|
+
...options
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
return {
|
|
23
19
|
name: INTEGRATION_NAME,
|
|
24
20
|
setup(client) {
|
|
25
|
-
// TODO(v11): Remove this functionality and use `consoleIntegration` from @sentry/core instead.
|
|
26
21
|
if (_options.console) {
|
|
27
22
|
addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));
|
|
28
23
|
}
|
|
@@ -39,290 +34,213 @@ const _breadcrumbsIntegration = ((options = {}) => {
|
|
|
39
34
|
addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));
|
|
40
35
|
}
|
|
41
36
|
if (_options.sentry) {
|
|
42
|
-
client.on(
|
|
37
|
+
client.on("beforeSendEvent", _getSentryBreadcrumbHandler(client));
|
|
43
38
|
}
|
|
44
|
-
}
|
|
39
|
+
}
|
|
45
40
|
};
|
|
46
|
-
})
|
|
47
|
-
|
|
41
|
+
});
|
|
48
42
|
const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
|
|
52
|
-
*/
|
|
53
43
|
function _getSentryBreadcrumbHandler(client) {
|
|
54
44
|
return function addSentryBreadcrumb(event) {
|
|
55
45
|
if (getClient() !== client) {
|
|
56
46
|
return;
|
|
57
47
|
}
|
|
58
|
-
|
|
59
48
|
addBreadcrumb(
|
|
60
49
|
{
|
|
61
|
-
category: `sentry.${event.type ===
|
|
50
|
+
category: `sentry.${event.type === "transaction" ? "transaction" : "event"}`,
|
|
62
51
|
event_id: event.event_id,
|
|
63
52
|
level: event.level,
|
|
64
|
-
message: getEventDescription(event)
|
|
53
|
+
message: getEventDescription(event)
|
|
65
54
|
},
|
|
66
55
|
{
|
|
67
|
-
event
|
|
68
|
-
}
|
|
56
|
+
event
|
|
57
|
+
}
|
|
69
58
|
);
|
|
70
59
|
};
|
|
71
60
|
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* A HOC that creates a function that creates breadcrumbs from DOM API calls.
|
|
75
|
-
* This is a HOC so that we get access to dom options in the closure.
|
|
76
|
-
*/
|
|
77
|
-
function _getDomBreadcrumbHandler(
|
|
78
|
-
client,
|
|
79
|
-
dom,
|
|
80
|
-
) {
|
|
61
|
+
function _getDomBreadcrumbHandler(client, dom) {
|
|
81
62
|
return function _innerDomBreadcrumb(handlerData) {
|
|
82
63
|
if (getClient() !== client) {
|
|
83
64
|
return;
|
|
84
65
|
}
|
|
85
|
-
|
|
86
66
|
let target;
|
|
87
67
|
let componentName;
|
|
88
|
-
let keyAttrs = typeof dom ===
|
|
89
|
-
|
|
90
|
-
let maxStringLength =
|
|
91
|
-
typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
|
|
68
|
+
let keyAttrs = typeof dom === "object" ? dom.serializeAttribute : void 0;
|
|
69
|
+
let maxStringLength = typeof dom === "object" && typeof dom.maxStringLength === "number" ? dom.maxStringLength : void 0;
|
|
92
70
|
if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
|
|
93
|
-
DEBUG_BUILD &&
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
71
|
+
DEBUG_BUILD && debug.warn(
|
|
72
|
+
`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`
|
|
73
|
+
);
|
|
97
74
|
maxStringLength = MAX_ALLOWED_STRING_LENGTH;
|
|
98
75
|
}
|
|
99
|
-
|
|
100
|
-
if (typeof keyAttrs === 'string') {
|
|
76
|
+
if (typeof keyAttrs === "string") {
|
|
101
77
|
keyAttrs = [keyAttrs];
|
|
102
78
|
}
|
|
103
|
-
|
|
104
|
-
// Accessing event.target can throw (see getsentry/raven-js#838, #768)
|
|
105
79
|
try {
|
|
106
|
-
const event = handlerData.event
|
|
80
|
+
const event = handlerData.event;
|
|
107
81
|
const element = _isEvent(event) ? event.target : event;
|
|
108
|
-
|
|
109
82
|
target = htmlTreeAsString(element, { keyAttrs, maxStringLength });
|
|
110
83
|
componentName = getComponentName(element);
|
|
111
84
|
} catch {
|
|
112
|
-
target =
|
|
85
|
+
target = "<unknown>";
|
|
113
86
|
}
|
|
114
|
-
|
|
115
87
|
if (target.length === 0) {
|
|
116
88
|
return;
|
|
117
89
|
}
|
|
118
|
-
|
|
119
90
|
const breadcrumb = {
|
|
120
91
|
category: `ui.${handlerData.name}`,
|
|
121
|
-
message: target
|
|
92
|
+
message: target
|
|
122
93
|
};
|
|
123
|
-
|
|
124
94
|
if (componentName) {
|
|
125
|
-
breadcrumb.data = {
|
|
95
|
+
breadcrumb.data = { "ui.component_name": componentName };
|
|
126
96
|
}
|
|
127
|
-
|
|
128
97
|
addBreadcrumb(breadcrumb, {
|
|
129
98
|
event: handlerData.event,
|
|
130
99
|
name: handlerData.name,
|
|
131
|
-
global: handlerData.global
|
|
100
|
+
global: handlerData.global
|
|
132
101
|
});
|
|
133
102
|
};
|
|
134
103
|
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Creates breadcrumbs from console API calls
|
|
138
|
-
*/
|
|
139
104
|
function _getConsoleBreadcrumbHandler(client) {
|
|
140
105
|
return function _consoleBreadcrumb(handlerData) {
|
|
141
106
|
if (getClient() !== client) {
|
|
142
107
|
return;
|
|
143
108
|
}
|
|
144
|
-
|
|
145
109
|
const breadcrumb = {
|
|
146
|
-
category:
|
|
110
|
+
category: "console",
|
|
147
111
|
data: {
|
|
148
112
|
arguments: handlerData.args,
|
|
149
|
-
logger:
|
|
113
|
+
logger: "console"
|
|
150
114
|
},
|
|
151
115
|
level: severityLevelFromString(handlerData.level),
|
|
152
|
-
message: safeJoin(handlerData.args,
|
|
116
|
+
message: safeJoin(handlerData.args, " ")
|
|
153
117
|
};
|
|
154
|
-
|
|
155
|
-
if (handlerData.level === 'assert') {
|
|
118
|
+
if (handlerData.level === "assert") {
|
|
156
119
|
if (handlerData.args[0] === false) {
|
|
157
|
-
breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1),
|
|
120
|
+
breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), " ") || "console.assert"}`;
|
|
158
121
|
breadcrumb.data.arguments = handlerData.args.slice(1);
|
|
159
122
|
} else {
|
|
160
|
-
// Don't capture a breadcrumb for passed assertions
|
|
161
123
|
return;
|
|
162
124
|
}
|
|
163
125
|
}
|
|
164
|
-
|
|
165
126
|
addBreadcrumb(breadcrumb, {
|
|
166
127
|
input: handlerData.args,
|
|
167
|
-
level: handlerData.level
|
|
128
|
+
level: handlerData.level
|
|
168
129
|
});
|
|
169
130
|
};
|
|
170
131
|
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Creates breadcrumbs from XHR API calls
|
|
174
|
-
*/
|
|
175
132
|
function _getXhrBreadcrumbHandler(client) {
|
|
176
133
|
return function _xhrBreadcrumb(handlerData) {
|
|
177
134
|
if (getClient() !== client) {
|
|
178
135
|
return;
|
|
179
136
|
}
|
|
180
|
-
|
|
181
137
|
const { startTimestamp, endTimestamp } = handlerData;
|
|
182
|
-
|
|
183
138
|
const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];
|
|
184
|
-
|
|
185
|
-
// We only capture complete, non-sentry requests
|
|
186
139
|
if (!startTimestamp || !endTimestamp || !sentryXhrData) {
|
|
187
140
|
return;
|
|
188
141
|
}
|
|
189
|
-
|
|
190
142
|
const { method, url, status_code, body } = sentryXhrData;
|
|
191
|
-
|
|
192
143
|
const data = {
|
|
193
144
|
method,
|
|
194
145
|
url,
|
|
195
|
-
status_code
|
|
146
|
+
status_code
|
|
196
147
|
};
|
|
197
|
-
|
|
198
148
|
const hint = {
|
|
199
149
|
xhr: handlerData.xhr,
|
|
200
150
|
input: body,
|
|
201
151
|
startTimestamp,
|
|
202
|
-
endTimestamp
|
|
152
|
+
endTimestamp
|
|
203
153
|
};
|
|
204
|
-
|
|
205
154
|
const breadcrumb = {
|
|
206
|
-
category:
|
|
155
|
+
category: "xhr",
|
|
207
156
|
data,
|
|
208
|
-
type:
|
|
209
|
-
level: getBreadcrumbLogLevelFromHttpStatusCode(status_code)
|
|
157
|
+
type: "http",
|
|
158
|
+
level: getBreadcrumbLogLevelFromHttpStatusCode(status_code)
|
|
210
159
|
};
|
|
211
|
-
|
|
212
|
-
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
213
|
-
|
|
160
|
+
client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
|
|
214
161
|
addBreadcrumb(breadcrumb, hint);
|
|
215
162
|
};
|
|
216
163
|
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Creates breadcrumbs from fetch API calls
|
|
220
|
-
*/
|
|
221
164
|
function _getFetchBreadcrumbHandler(client) {
|
|
222
165
|
return function _fetchBreadcrumb(handlerData) {
|
|
223
166
|
if (getClient() !== client) {
|
|
224
167
|
return;
|
|
225
168
|
}
|
|
226
|
-
|
|
227
169
|
const { startTimestamp, endTimestamp } = handlerData;
|
|
228
|
-
|
|
229
|
-
// We only capture complete fetch requests
|
|
230
170
|
if (!endTimestamp) {
|
|
231
171
|
return;
|
|
232
172
|
}
|
|
233
|
-
|
|
234
|
-
if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {
|
|
235
|
-
// We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)
|
|
173
|
+
if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === "POST") {
|
|
236
174
|
return;
|
|
237
175
|
}
|
|
238
|
-
|
|
239
176
|
if (handlerData.error) {
|
|
240
177
|
const hint = {
|
|
241
178
|
data: handlerData.error,
|
|
242
179
|
input: handlerData.args,
|
|
243
180
|
startTimestamp,
|
|
244
|
-
endTimestamp
|
|
181
|
+
endTimestamp
|
|
245
182
|
};
|
|
246
|
-
|
|
247
183
|
const breadcrumb = {
|
|
248
|
-
category:
|
|
184
|
+
category: "fetch",
|
|
249
185
|
data: handlerData.fetchData,
|
|
250
|
-
level:
|
|
251
|
-
type:
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
255
|
-
|
|
186
|
+
level: "error",
|
|
187
|
+
type: "http"
|
|
188
|
+
};
|
|
189
|
+
client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
|
|
256
190
|
addBreadcrumb(breadcrumb, hint);
|
|
257
191
|
} else {
|
|
258
|
-
const response = handlerData.response
|
|
192
|
+
const response = handlerData.response;
|
|
259
193
|
const data = {
|
|
260
194
|
...handlerData.fetchData,
|
|
261
|
-
status_code: response?.status
|
|
195
|
+
status_code: response?.status
|
|
262
196
|
};
|
|
263
|
-
|
|
264
197
|
const hint = {
|
|
265
198
|
input: handlerData.args,
|
|
266
199
|
response,
|
|
267
200
|
startTimestamp,
|
|
268
|
-
endTimestamp
|
|
201
|
+
endTimestamp
|
|
269
202
|
};
|
|
270
|
-
|
|
271
203
|
const breadcrumb = {
|
|
272
|
-
category:
|
|
204
|
+
category: "fetch",
|
|
273
205
|
data,
|
|
274
|
-
type:
|
|
275
|
-
level: getBreadcrumbLogLevelFromHttpStatusCode(data.status_code)
|
|
206
|
+
type: "http",
|
|
207
|
+
level: getBreadcrumbLogLevelFromHttpStatusCode(data.status_code)
|
|
276
208
|
};
|
|
277
|
-
|
|
278
|
-
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
279
|
-
|
|
209
|
+
client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
|
|
280
210
|
addBreadcrumb(breadcrumb, hint);
|
|
281
211
|
}
|
|
282
212
|
};
|
|
283
213
|
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Creates breadcrumbs from history API calls
|
|
287
|
-
*/
|
|
288
214
|
function _getHistoryBreadcrumbHandler(client) {
|
|
289
215
|
return function _historyBreadcrumb(handlerData) {
|
|
290
216
|
if (getClient() !== client) {
|
|
291
217
|
return;
|
|
292
218
|
}
|
|
293
|
-
|
|
294
219
|
let from = handlerData.from;
|
|
295
220
|
let to = handlerData.to;
|
|
296
221
|
const parsedLoc = parseUrl(WINDOW.location.href);
|
|
297
|
-
let parsedFrom = from ? parseUrl(from) :
|
|
222
|
+
let parsedFrom = from ? parseUrl(from) : void 0;
|
|
298
223
|
const parsedTo = parseUrl(to);
|
|
299
|
-
|
|
300
|
-
// Initial pushState doesn't provide `from` information
|
|
301
224
|
if (!parsedFrom?.path) {
|
|
302
225
|
parsedFrom = parsedLoc;
|
|
303
226
|
}
|
|
304
|
-
|
|
305
|
-
// Use only the path component of the URL if the URL matches the current
|
|
306
|
-
// document (almost all the time when using pushState)
|
|
307
227
|
if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
|
|
308
228
|
to = parsedTo.relative;
|
|
309
229
|
}
|
|
310
230
|
if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
|
|
311
231
|
from = parsedFrom.relative;
|
|
312
232
|
}
|
|
313
|
-
|
|
314
233
|
addBreadcrumb({
|
|
315
|
-
category:
|
|
234
|
+
category: "navigation",
|
|
316
235
|
data: {
|
|
317
236
|
from,
|
|
318
|
-
to
|
|
319
|
-
}
|
|
237
|
+
to
|
|
238
|
+
}
|
|
320
239
|
});
|
|
321
240
|
};
|
|
322
241
|
}
|
|
323
|
-
|
|
324
242
|
function _isEvent(event) {
|
|
325
|
-
return !!event && !!
|
|
243
|
+
return !!event && !!event.target;
|
|
326
244
|
}
|
|
327
245
|
|
|
328
246
|
export { breadcrumbsIntegration };
|