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