@sentry/browser 10.24.0 → 10.26.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.map +1 -0
- package/build/npm/cjs/dev/debug-build.js.map +1 -0
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
- package/build/npm/cjs/dev/helpers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +1 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +73 -75
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -0
- package/build/npm/cjs/{profiling → dev/profiling}/integration.js +5 -5
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
- package/build/npm/cjs/dev/report-dialog.js.map +1 -0
- package/build/npm/cjs/dev/sdk.js +133 -0
- package/build/npm/cjs/dev/sdk.js.map +1 -0
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/dev/tracing/request.js.map +1 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
- package/build/npm/cjs/dev/transports/offline.js.map +1 -0
- package/build/npm/cjs/dev/userfeedback.js.map +1 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/cjs/prod/client.js +125 -0
- package/build/npm/cjs/prod/client.js.map +1 -0
- package/build/npm/cjs/prod/debug-build.js +11 -0
- package/build/npm/cjs/prod/debug-build.js.map +1 -0
- package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/prod/eventbuilder.js +397 -0
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
- package/build/npm/cjs/prod/feedbackAsync.js +15 -0
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/prod/feedbackSync.js +12 -0
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
- package/build/npm/cjs/prod/helpers.js +185 -0
- package/build/npm/cjs/prod/helpers.js.map +1 -0
- package/build/npm/cjs/prod/index.js +179 -0
- package/build/npm/cjs/prod/index.js.map +1 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/prod/profiling/UIProfiler.js +341 -0
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -0
- package/build/npm/cjs/prod/profiling/integration.js +150 -0
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/prod/profiling/utils.js +786 -0
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
- package/build/npm/cjs/prod/report-dialog.js +68 -0
- package/build/npm/cjs/prod/report-dialog.js.map +1 -0
- package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/cjs/prod/sdk.js.map +1 -0
- package/build/npm/cjs/prod/stack-parsers.js +202 -0
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/prod/tracing/request.js +342 -0
- package/build/npm/cjs/prod/tracing/request.js.map +1 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/prod/tracing/utils.js +54 -0
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
- package/build/npm/cjs/prod/transports/fetch.js +71 -0
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
- package/build/npm/cjs/prod/transports/offline.js +168 -0
- package/build/npm/cjs/prod/transports/offline.js.map +1 -0
- package/build/npm/cjs/prod/userfeedback.js +42 -0
- package/build/npm/cjs/prod/userfeedback.js.map +1 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/dev/client.js.map +1 -0
- package/build/npm/esm/dev/debug-build.js.map +1 -0
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/dev/eventbuilder.js.map +1 -0
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
- package/build/npm/esm/dev/feedbackSync.js.map +1 -0
- package/build/npm/esm/dev/helpers.js.map +1 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +1 -1
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/dev/package.json +1 -0
- package/build/npm/esm/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +74 -76
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -0
- package/build/npm/esm/{profiling → dev/profiling}/integration.js +2 -2
- package/build/npm/esm/dev/profiling/integration.js.map +1 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/dev/profiling/utils.js.map +1 -0
- package/build/npm/esm/dev/report-dialog.js.map +1 -0
- package/build/npm/esm/dev/sdk.js +128 -0
- package/build/npm/esm/dev/sdk.js.map +1 -0
- package/build/npm/esm/dev/stack-parsers.js.map +1 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/dev/tracing/request.js.map +1 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/dev/tracing/utils.js.map +1 -0
- package/build/npm/esm/dev/transports/fetch.js.map +1 -0
- package/build/npm/esm/dev/transports/offline.js.map +1 -0
- package/build/npm/esm/dev/userfeedback.js.map +1 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/prod/client.js +122 -0
- package/build/npm/esm/prod/client.js.map +1 -0
- package/build/npm/esm/prod/debug-build.js +9 -0
- package/build/npm/esm/prod/debug-build.js.map +1 -0
- package/build/npm/esm/prod/diagnose-sdk.js +49 -0
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/prod/eventbuilder.js +390 -0
- package/build/npm/esm/prod/eventbuilder.js.map +1 -0
- package/build/npm/esm/prod/feedbackAsync.js +13 -0
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
- package/build/npm/esm/prod/feedbackSync.js +10 -0
- package/build/npm/esm/prod/feedbackSync.js.map +1 -0
- package/build/npm/esm/prod/helpers.js +179 -0
- package/build/npm/esm/prod/helpers.js.map +1 -0
- package/build/npm/esm/prod/index.js +40 -0
- package/build/npm/esm/prod/index.js.map +1 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/browsersession.js +42 -0
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/prod/integrations/contextlines.js +86 -0
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpclient.js +393 -0
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/prod/integrations/spotlight.js +81 -0
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/prod/integrations/webWorker.js +247 -0
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/prod/package.json +1 -0
- package/build/npm/esm/prod/profiling/UIProfiler.js +339 -0
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -0
- package/build/npm/esm/prod/profiling/integration.js +148 -0
- package/build/npm/esm/prod/profiling/integration.js.map +1 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/prod/profiling/utils.js +763 -0
- package/build/npm/esm/prod/profiling/utils.js.map +1 -0
- package/build/npm/esm/prod/report-dialog.js +66 -0
- package/build/npm/esm/prod/report-dialog.js.map +1 -0
- package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/esm/prod/sdk.js.map +1 -0
- package/build/npm/esm/prod/stack-parsers.js +194 -0
- package/build/npm/esm/prod/stack-parsers.js.map +1 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/prod/tracing/request.js +338 -0
- package/build/npm/esm/prod/tracing/request.js.map +1 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/prod/tracing/utils.js +49 -0
- package/build/npm/esm/prod/tracing/utils.js.map +1 -0
- package/build/npm/esm/prod/transports/fetch.js +69 -0
- package/build/npm/esm/prod/transports/fetch.js.map +1 -0
- package/build/npm/esm/prod/transports/offline.js +162 -0
- package/build/npm/esm/prod/transports/offline.js.map +1 -0
- package/build/npm/esm/prod/userfeedback.js +40 -0
- package/build/npm/esm/prod/userfeedback.js.map +1 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/types/client.d.ts +11 -0
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
- package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -0
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +11 -0
- package/build/npm/types-ts3.8/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
- package/package.json +21 -16
- package/build/npm/cjs/client.js.map +0 -1
- package/build/npm/cjs/debug-build.js.map +0 -1
- package/build/npm/cjs/diagnose-sdk.js.map +0 -1
- package/build/npm/cjs/eventbuilder.js.map +0 -1
- package/build/npm/cjs/feedbackAsync.js.map +0 -1
- package/build/npm/cjs/feedbackSync.js.map +0 -1
- package/build/npm/cjs/helpers.js.map +0 -1
- package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
- package/build/npm/cjs/integrations/browsersession.js.map +0 -1
- package/build/npm/cjs/integrations/contextlines.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
- package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
- package/build/npm/cjs/integrations/httpclient.js.map +0 -1
- package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
- package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
- package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
- package/build/npm/cjs/integrations/spotlight.js.map +0 -1
- package/build/npm/cjs/integrations/webWorker.js.map +0 -1
- package/build/npm/cjs/profiling/integration.js.map +0 -1
- package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/cjs/profiling/utils.js.map +0 -1
- package/build/npm/cjs/report-dialog.js.map +0 -1
- package/build/npm/cjs/sdk.js.map +0 -1
- package/build/npm/cjs/stack-parsers.js.map +0 -1
- package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
- package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
- package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/cjs/tracing/request.js.map +0 -1
- package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/cjs/tracing/utils.js.map +0 -1
- package/build/npm/cjs/transports/fetch.js.map +0 -1
- package/build/npm/cjs/transports/offline.js.map +0 -1
- package/build/npm/cjs/userfeedback.js.map +0 -1
- package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
- package/build/npm/esm/client.js.map +0 -1
- package/build/npm/esm/debug-build.js.map +0 -1
- package/build/npm/esm/diagnose-sdk.js.map +0 -1
- package/build/npm/esm/eventbuilder.js.map +0 -1
- package/build/npm/esm/feedbackAsync.js.map +0 -1
- package/build/npm/esm/feedbackSync.js.map +0 -1
- package/build/npm/esm/helpers.js.map +0 -1
- package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
- package/build/npm/esm/integrations/browsersession.js.map +0 -1
- package/build/npm/esm/integrations/contextlines.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
- package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
- package/build/npm/esm/integrations/httpclient.js.map +0 -1
- package/build/npm/esm/integrations/httpcontext.js.map +0 -1
- package/build/npm/esm/integrations/linkederrors.js.map +0 -1
- package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
- package/build/npm/esm/integrations/spotlight.js.map +0 -1
- package/build/npm/esm/integrations/webWorker.js.map +0 -1
- package/build/npm/esm/package.json +0 -1
- package/build/npm/esm/profiling/integration.js.map +0 -1
- package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/esm/profiling/utils.js.map +0 -1
- package/build/npm/esm/report-dialog.js.map +0 -1
- package/build/npm/esm/sdk.js.map +0 -1
- package/build/npm/esm/stack-parsers.js.map +0 -1
- package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
- package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
- package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/esm/tracing/request.js.map +0 -1
- package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/esm/tracing/utils.js.map +0 -1
- package/build/npm/esm/transports/fetch.js.map +0 -1
- package/build/npm/esm/transports/offline.js.map +0 -1
- package/build/npm/esm/userfeedback.js.map +0 -1
- package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
- package/build/npm/types/profiling/lifecycleMode/traceLifecycleProfiler.d.ts.map +0 -1
- /package/build/npm/cjs/{client.js → dev/client.js} +0 -0
- /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
- /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/cjs/{transports → dev/transports}/fetch.js +0 -0
- /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
- /package/build/npm/esm/{client.js → dev/client.js} +0 -0
- /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/esm/{index.js → dev/index.js} +0 -0
- /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/webWorker.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/esm/{transports → dev/transports}/fetch.js +0 -0
- /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { feedbackAsyncIntegration } from './feedbackAsync.js';
|
|
2
|
+
export { feedbackSyncIntegration as feedbackIntegration, feedbackSyncIntegration } from './feedbackSync.js';
|
|
3
|
+
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createConsolaReporter, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentOpenAiClient, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, logger, makeMultiplexedTransport, metrics, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, zodErrorsIntegration } from '@sentry/core';
|
|
4
|
+
export { WINDOW } from './helpers.js';
|
|
5
|
+
export { BrowserClient } from './client.js';
|
|
6
|
+
export { makeFetchTransport } from './transports/fetch.js';
|
|
7
|
+
export { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser } from './stack-parsers.js';
|
|
8
|
+
export { eventFromException, eventFromMessage, exceptionFromError } from './eventbuilder.js';
|
|
9
|
+
export { createUserFeedbackEnvelope } from './userfeedback.js';
|
|
10
|
+
export { forceLoad, getDefaultIntegrations, init, onLoad } from './sdk.js';
|
|
11
|
+
export { showReportDialog } from './report-dialog.js';
|
|
12
|
+
export { breadcrumbsIntegration } from './integrations/breadcrumbs.js';
|
|
13
|
+
export { globalHandlersIntegration } from './integrations/globalhandlers.js';
|
|
14
|
+
export { httpContextIntegration } from './integrations/httpcontext.js';
|
|
15
|
+
export { linkedErrorsIntegration } from './integrations/linkederrors.js';
|
|
16
|
+
export { browserApiErrorsIntegration } from './integrations/browserapierrors.js';
|
|
17
|
+
export { lazyLoadIntegration } from './utils/lazyLoadIntegration.js';
|
|
18
|
+
export { reportingObserverIntegration } from './integrations/reportingobserver.js';
|
|
19
|
+
export { httpClientIntegration } from './integrations/httpclient.js';
|
|
20
|
+
export { contextLinesIntegration } from './integrations/contextlines.js';
|
|
21
|
+
export { graphqlClientIntegration } from './integrations/graphqlClient.js';
|
|
22
|
+
export { getReplay, replayIntegration } from '@sentry-internal/replay';
|
|
23
|
+
export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';
|
|
24
|
+
export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
|
|
25
|
+
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './tracing/request.js';
|
|
26
|
+
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan } from './tracing/browserTracingIntegration.js';
|
|
27
|
+
export { reportPageLoaded } from './tracing/reportPageLoaded.js';
|
|
28
|
+
export { setActiveSpanInBrowser } from './tracing/setActiveSpan.js';
|
|
29
|
+
export { makeBrowserOfflineTransport } from './transports/offline.js';
|
|
30
|
+
export { browserProfilingIntegration } from './profiling/integration.js';
|
|
31
|
+
export { spotlightBrowserIntegration } from './integrations/spotlight.js';
|
|
32
|
+
export { browserSessionIntegration } from './integrations/browsersession.js';
|
|
33
|
+
export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration } from './integrations/featureFlags/launchdarkly/integration.js';
|
|
34
|
+
export { OpenFeatureIntegrationHook, openFeatureIntegration } from './integrations/featureFlags/openfeature/integration.js';
|
|
35
|
+
export { unleashIntegration } from './integrations/featureFlags/unleash/integration.js';
|
|
36
|
+
export { growthbookIntegration } from './integrations/featureFlags/growthbook/integration.js';
|
|
37
|
+
export { statsigIntegration } from './integrations/featureFlags/statsig/integration.js';
|
|
38
|
+
export { diagnoseSdkConnectivity } from './diagnose-sdk.js';
|
|
39
|
+
export { registerWebWorker, webWorkerIntegration } from './integrations/webWorker.js';
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { defineIntegration, addConsoleInstrumentationHandler, addFetchInstrumentationHandler, getClient, safeJoin, severityLevelFromString, addBreadcrumb, debug, htmlTreeAsString, getComponentName, getBreadcrumbLogLevelFromHttpStatusCode, parseUrl, getEventDescription } from '@sentry/core';
|
|
2
|
+
import { addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addHistoryInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';
|
|
3
|
+
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
|
+
import { WINDOW } from '../helpers.js';
|
|
5
|
+
|
|
6
|
+
/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */
|
|
7
|
+
const MAX_ALLOWED_STRING_LENGTH = 1024;
|
|
8
|
+
|
|
9
|
+
const INTEGRATION_NAME = 'Breadcrumbs';
|
|
10
|
+
|
|
11
|
+
const _breadcrumbsIntegration = ((options = {}) => {
|
|
12
|
+
const _options = {
|
|
13
|
+
console: true,
|
|
14
|
+
dom: true,
|
|
15
|
+
fetch: true,
|
|
16
|
+
history: true,
|
|
17
|
+
sentry: true,
|
|
18
|
+
xhr: true,
|
|
19
|
+
...options,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
name: INTEGRATION_NAME,
|
|
24
|
+
setup(client) {
|
|
25
|
+
// TODO(v11): Remove this functionality and use `consoleIntegration` from @sentry/core instead.
|
|
26
|
+
if (_options.console) {
|
|
27
|
+
addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));
|
|
28
|
+
}
|
|
29
|
+
if (_options.dom) {
|
|
30
|
+
addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));
|
|
31
|
+
}
|
|
32
|
+
if (_options.xhr) {
|
|
33
|
+
addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));
|
|
34
|
+
}
|
|
35
|
+
if (_options.fetch) {
|
|
36
|
+
addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));
|
|
37
|
+
}
|
|
38
|
+
if (_options.history) {
|
|
39
|
+
addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));
|
|
40
|
+
}
|
|
41
|
+
if (_options.sentry) {
|
|
42
|
+
client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}) ;
|
|
47
|
+
|
|
48
|
+
const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
|
|
52
|
+
*/
|
|
53
|
+
function _getSentryBreadcrumbHandler(client) {
|
|
54
|
+
return function addSentryBreadcrumb(event) {
|
|
55
|
+
if (getClient() !== client) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
addBreadcrumb(
|
|
60
|
+
{
|
|
61
|
+
category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
|
|
62
|
+
event_id: event.event_id,
|
|
63
|
+
level: event.level,
|
|
64
|
+
message: getEventDescription(event),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
event,
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
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
|
+
) {
|
|
81
|
+
return function _innerDomBreadcrumb(handlerData) {
|
|
82
|
+
if (getClient() !== client) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let target;
|
|
87
|
+
let componentName;
|
|
88
|
+
let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;
|
|
89
|
+
|
|
90
|
+
let maxStringLength =
|
|
91
|
+
typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
|
|
92
|
+
if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
|
|
93
|
+
DEBUG_BUILD &&
|
|
94
|
+
debug.warn(
|
|
95
|
+
`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,
|
|
96
|
+
);
|
|
97
|
+
maxStringLength = MAX_ALLOWED_STRING_LENGTH;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof keyAttrs === 'string') {
|
|
101
|
+
keyAttrs = [keyAttrs];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Accessing event.target can throw (see getsentry/raven-js#838, #768)
|
|
105
|
+
try {
|
|
106
|
+
const event = handlerData.event ;
|
|
107
|
+
const element = _isEvent(event) ? event.target : event;
|
|
108
|
+
|
|
109
|
+
target = htmlTreeAsString(element, { keyAttrs, maxStringLength });
|
|
110
|
+
componentName = getComponentName(element);
|
|
111
|
+
} catch {
|
|
112
|
+
target = '<unknown>';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (target.length === 0) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const breadcrumb = {
|
|
120
|
+
category: `ui.${handlerData.name}`,
|
|
121
|
+
message: target,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
if (componentName) {
|
|
125
|
+
breadcrumb.data = { 'ui.component_name': componentName };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
addBreadcrumb(breadcrumb, {
|
|
129
|
+
event: handlerData.event,
|
|
130
|
+
name: handlerData.name,
|
|
131
|
+
global: handlerData.global,
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Creates breadcrumbs from console API calls
|
|
138
|
+
*/
|
|
139
|
+
function _getConsoleBreadcrumbHandler(client) {
|
|
140
|
+
return function _consoleBreadcrumb(handlerData) {
|
|
141
|
+
if (getClient() !== client) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const breadcrumb = {
|
|
146
|
+
category: 'console',
|
|
147
|
+
data: {
|
|
148
|
+
arguments: handlerData.args,
|
|
149
|
+
logger: 'console',
|
|
150
|
+
},
|
|
151
|
+
level: severityLevelFromString(handlerData.level),
|
|
152
|
+
message: safeJoin(handlerData.args, ' '),
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
if (handlerData.level === 'assert') {
|
|
156
|
+
if (handlerData.args[0] === false) {
|
|
157
|
+
breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
|
|
158
|
+
breadcrumb.data.arguments = handlerData.args.slice(1);
|
|
159
|
+
} else {
|
|
160
|
+
// Don't capture a breadcrumb for passed assertions
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
addBreadcrumb(breadcrumb, {
|
|
166
|
+
input: handlerData.args,
|
|
167
|
+
level: handlerData.level,
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Creates breadcrumbs from XHR API calls
|
|
174
|
+
*/
|
|
175
|
+
function _getXhrBreadcrumbHandler(client) {
|
|
176
|
+
return function _xhrBreadcrumb(handlerData) {
|
|
177
|
+
if (getClient() !== client) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const { startTimestamp, endTimestamp } = handlerData;
|
|
182
|
+
|
|
183
|
+
const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];
|
|
184
|
+
|
|
185
|
+
// We only capture complete, non-sentry requests
|
|
186
|
+
if (!startTimestamp || !endTimestamp || !sentryXhrData) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const { method, url, status_code, body } = sentryXhrData;
|
|
191
|
+
|
|
192
|
+
const data = {
|
|
193
|
+
method,
|
|
194
|
+
url,
|
|
195
|
+
status_code,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const hint = {
|
|
199
|
+
xhr: handlerData.xhr,
|
|
200
|
+
input: body,
|
|
201
|
+
startTimestamp,
|
|
202
|
+
endTimestamp,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const breadcrumb = {
|
|
206
|
+
category: 'xhr',
|
|
207
|
+
data,
|
|
208
|
+
type: 'http',
|
|
209
|
+
level: getBreadcrumbLogLevelFromHttpStatusCode(status_code),
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
213
|
+
|
|
214
|
+
addBreadcrumb(breadcrumb, hint);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Creates breadcrumbs from fetch API calls
|
|
220
|
+
*/
|
|
221
|
+
function _getFetchBreadcrumbHandler(client) {
|
|
222
|
+
return function _fetchBreadcrumb(handlerData) {
|
|
223
|
+
if (getClient() !== client) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const { startTimestamp, endTimestamp } = handlerData;
|
|
228
|
+
|
|
229
|
+
// We only capture complete fetch requests
|
|
230
|
+
if (!endTimestamp) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
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)
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
({
|
|
240
|
+
method: handlerData.fetchData.method,
|
|
241
|
+
url: handlerData.fetchData.url,
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
if (handlerData.error) {
|
|
245
|
+
const data = handlerData.fetchData;
|
|
246
|
+
const hint = {
|
|
247
|
+
data: handlerData.error,
|
|
248
|
+
input: handlerData.args,
|
|
249
|
+
startTimestamp,
|
|
250
|
+
endTimestamp,
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const breadcrumb = {
|
|
254
|
+
category: 'fetch',
|
|
255
|
+
data,
|
|
256
|
+
level: 'error',
|
|
257
|
+
type: 'http',
|
|
258
|
+
} ;
|
|
259
|
+
|
|
260
|
+
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
261
|
+
|
|
262
|
+
addBreadcrumb(breadcrumb, hint);
|
|
263
|
+
} else {
|
|
264
|
+
const response = handlerData.response ;
|
|
265
|
+
const data = {
|
|
266
|
+
...handlerData.fetchData,
|
|
267
|
+
status_code: response?.status,
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
handlerData.fetchData.request_body_size;
|
|
271
|
+
handlerData.fetchData.response_body_size;
|
|
272
|
+
response?.status;
|
|
273
|
+
|
|
274
|
+
const hint = {
|
|
275
|
+
input: handlerData.args,
|
|
276
|
+
response,
|
|
277
|
+
startTimestamp,
|
|
278
|
+
endTimestamp,
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const breadcrumb = {
|
|
282
|
+
category: 'fetch',
|
|
283
|
+
data,
|
|
284
|
+
type: 'http',
|
|
285
|
+
level: getBreadcrumbLogLevelFromHttpStatusCode(data.status_code),
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
289
|
+
|
|
290
|
+
addBreadcrumb(breadcrumb, hint);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Creates breadcrumbs from history API calls
|
|
297
|
+
*/
|
|
298
|
+
function _getHistoryBreadcrumbHandler(client) {
|
|
299
|
+
return function _historyBreadcrumb(handlerData) {
|
|
300
|
+
if (getClient() !== client) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
let from = handlerData.from;
|
|
305
|
+
let to = handlerData.to;
|
|
306
|
+
const parsedLoc = parseUrl(WINDOW.location.href);
|
|
307
|
+
let parsedFrom = from ? parseUrl(from) : undefined;
|
|
308
|
+
const parsedTo = parseUrl(to);
|
|
309
|
+
|
|
310
|
+
// Initial pushState doesn't provide `from` information
|
|
311
|
+
if (!parsedFrom?.path) {
|
|
312
|
+
parsedFrom = parsedLoc;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Use only the path component of the URL if the URL matches the current
|
|
316
|
+
// document (almost all the time when using pushState)
|
|
317
|
+
if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
|
|
318
|
+
to = parsedTo.relative;
|
|
319
|
+
}
|
|
320
|
+
if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
|
|
321
|
+
from = parsedFrom.relative;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
addBreadcrumb({
|
|
325
|
+
category: 'navigation',
|
|
326
|
+
data: {
|
|
327
|
+
from,
|
|
328
|
+
to,
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function _isEvent(event) {
|
|
335
|
+
return !!event && !!(event ).target;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export { breadcrumbsIntegration };
|
|
339
|
+
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sources":["../../../../../src/integrations/breadcrumbs.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport type {\n Breadcrumb,\n Client,\n Event as SentryEvent,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n IntegrationFn,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/core';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n debug,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/core';\nimport type { FetchHint, XhrHint } from '@sentry-internal/browser-utils';\nimport {\n addClickKeypressInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n SENTRY_XHR_DATA_KEY,\n} from '@sentry-internal/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BreadcrumbsOptions {\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n // TODO(v11): Remove this functionality and use `consoleIntegration` from @sentry/core instead.\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): void {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creates a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client: Client,\n dom: BreadcrumbsOptions['dom'],\n): (handlerData: HandlerDataDom) => void {\n return function _innerDomBreadcrumb(handlerData: HandlerDataDom): void {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n debug.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event as Event | Node;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb: Breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client: Client): (handlerData: HandlerDataConsole) => void {\n return function _consoleBreadcrumb(handlerData: HandlerDataConsole): void {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client: Client): (handlerData: HandlerDataXhr) => void {\n return function _xhrBreadcrumb(handlerData: HandlerDataXhr): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data: XhrBreadcrumbData = {\n method,\n url,\n status_code,\n };\n\n const hint: XhrBreadcrumbHint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'xhr',\n data,\n type: 'http',\n level: getBreadcrumbLogLevelFromHttpStatusCode(status_code),\n };\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as XhrHint);\n\n addBreadcrumb(breadcrumb, hint);\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client: Client): (handlerData: HandlerDataFetch) => void {\n return function _fetchBreadcrumb(handlerData: HandlerDataFetch): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n const breadcrumbData: FetchBreadcrumbData = {\n method: handlerData.fetchData.method,\n url: handlerData.fetchData.url,\n };\n\n if (handlerData.error) {\n const data: FetchBreadcrumbData = handlerData.fetchData;\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n } satisfies Breadcrumb;\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as FetchHint);\n\n addBreadcrumb(breadcrumb, hint);\n } else {\n const response = handlerData.response as Response | undefined;\n const data: FetchBreadcrumbData = {\n ...handlerData.fetchData,\n status_code: response?.status,\n };\n\n breadcrumbData.request_body_size = handlerData.fetchData.request_body_size;\n breadcrumbData.response_body_size = handlerData.fetchData.response_body_size;\n breadcrumbData.status_code = response?.status;\n\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'fetch',\n data,\n type: 'http',\n level: getBreadcrumbLogLevelFromHttpStatusCode(data.status_code),\n };\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as FetchHint);\n\n addBreadcrumb(breadcrumb, hint);\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client: Client): (handlerData: HandlerDataHistory) => void {\n return function _historyBreadcrumb(handlerData: HandlerDataHistory): void {\n if (getClient() !== client) {\n return;\n }\n\n let from: string | undefined = handlerData.from;\n let to: string | undefined = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom?.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event: unknown): event is Event {\n return !!event && !!(event as Record<string, unknown>).target;\n}\n"],"names":[],"mappings":";;;;;AAwDA;AACA,MAAM,yBAAA,GAA4B,IAAI;;AAEtC,MAAM,gBAAA,GAAmB,aAAa;;AAEtC,MAAM,uBAAA,IAA2B,CAAC,O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 @@
|
|
|
1
|
+
import { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core';
|
|
2
|
+
import { WINDOW, wrap } from '../helpers.js';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_EVENT_TARGET = [
|
|
5
|
+
'EventTarget',
|
|
6
|
+
'Window',
|
|
7
|
+
'Node',
|
|
8
|
+
'ApplicationCache',
|
|
9
|
+
'AudioTrackList',
|
|
10
|
+
'BroadcastChannel',
|
|
11
|
+
'ChannelMergerNode',
|
|
12
|
+
'CryptoOperation',
|
|
13
|
+
'EventSource',
|
|
14
|
+
'FileReader',
|
|
15
|
+
'HTMLUnknownElement',
|
|
16
|
+
'IDBDatabase',
|
|
17
|
+
'IDBRequest',
|
|
18
|
+
'IDBTransaction',
|
|
19
|
+
'KeyOperation',
|
|
20
|
+
'MediaController',
|
|
21
|
+
'MessagePort',
|
|
22
|
+
'ModalWindow',
|
|
23
|
+
'Notification',
|
|
24
|
+
'SVGElementInstance',
|
|
25
|
+
'Screen',
|
|
26
|
+
'SharedWorker',
|
|
27
|
+
'TextTrack',
|
|
28
|
+
'TextTrackCue',
|
|
29
|
+
'TextTrackList',
|
|
30
|
+
'WebSocket',
|
|
31
|
+
'WebSocketWorker',
|
|
32
|
+
'Worker',
|
|
33
|
+
'XMLHttpRequest',
|
|
34
|
+
'XMLHttpRequestEventTarget',
|
|
35
|
+
'XMLHttpRequestUpload',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const INTEGRATION_NAME = 'BrowserApiErrors';
|
|
39
|
+
|
|
40
|
+
const _browserApiErrorsIntegration = ((options = {}) => {
|
|
41
|
+
const _options = {
|
|
42
|
+
XMLHttpRequest: true,
|
|
43
|
+
eventTarget: true,
|
|
44
|
+
requestAnimationFrame: true,
|
|
45
|
+
setInterval: true,
|
|
46
|
+
setTimeout: true,
|
|
47
|
+
unregisterOriginalCallbacks: false,
|
|
48
|
+
...options,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
name: INTEGRATION_NAME,
|
|
53
|
+
// TODO: This currently only works for the first client this is setup
|
|
54
|
+
// We may want to adjust this to check for client etc.
|
|
55
|
+
setupOnce() {
|
|
56
|
+
if (_options.setTimeout) {
|
|
57
|
+
fill(WINDOW, 'setTimeout', _wrapTimeFunction);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (_options.setInterval) {
|
|
61
|
+
fill(WINDOW, 'setInterval', _wrapTimeFunction);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (_options.requestAnimationFrame) {
|
|
65
|
+
fill(WINDOW, 'requestAnimationFrame', _wrapRAF);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {
|
|
69
|
+
fill(XMLHttpRequest.prototype, 'send', _wrapXHR);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const eventTargetOption = _options.eventTarget;
|
|
73
|
+
if (eventTargetOption) {
|
|
74
|
+
const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
|
|
75
|
+
eventTarget.forEach(target => _wrapEventTarget(target, _options));
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}) ;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Wrap timer functions and event targets to catch errors and provide better meta data.
|
|
83
|
+
*/
|
|
84
|
+
const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);
|
|
85
|
+
|
|
86
|
+
function _wrapTimeFunction(original) {
|
|
87
|
+
return function ( ...args) {
|
|
88
|
+
const originalCallback = args[0];
|
|
89
|
+
args[0] = wrap(originalCallback, {
|
|
90
|
+
mechanism: {
|
|
91
|
+
handled: false,
|
|
92
|
+
type: `auto.browser.browserapierrors.${getFunctionName(original)}`,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
return original.apply(this, args);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function _wrapRAF(original) {
|
|
100
|
+
return function ( callback) {
|
|
101
|
+
return original.apply(this, [
|
|
102
|
+
wrap(callback, {
|
|
103
|
+
mechanism: {
|
|
104
|
+
data: {
|
|
105
|
+
handler: getFunctionName(original),
|
|
106
|
+
},
|
|
107
|
+
handled: false,
|
|
108
|
+
type: 'auto.browser.browserapierrors.requestAnimationFrame',
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
]);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function _wrapXHR(originalSend) {
|
|
116
|
+
return function ( ...args) {
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
118
|
+
const xhr = this;
|
|
119
|
+
const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];
|
|
120
|
+
|
|
121
|
+
xmlHttpRequestProps.forEach(prop => {
|
|
122
|
+
if (prop in xhr && typeof xhr[prop] === 'function') {
|
|
123
|
+
fill(xhr, prop, function (original) {
|
|
124
|
+
const wrapOptions = {
|
|
125
|
+
mechanism: {
|
|
126
|
+
data: {
|
|
127
|
+
handler: getFunctionName(original),
|
|
128
|
+
},
|
|
129
|
+
handled: false,
|
|
130
|
+
type: `auto.browser.browserapierrors.xhr.${prop}`,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// If Instrument integration has been called before BrowserApiErrors, get the name of original function
|
|
135
|
+
const originalFunction = getOriginalFunction(original);
|
|
136
|
+
if (originalFunction) {
|
|
137
|
+
wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Otherwise wrap directly
|
|
141
|
+
return wrap(original, wrapOptions);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return originalSend.apply(this, args);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function _wrapEventTarget(target, integrationOptions) {
|
|
151
|
+
const globalObject = WINDOW ;
|
|
152
|
+
const proto = globalObject[target]?.prototype;
|
|
153
|
+
|
|
154
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
155
|
+
if (!proto?.hasOwnProperty?.('addEventListener')) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
fill(proto, 'addEventListener', function (original)
|
|
160
|
+
|
|
161
|
+
{
|
|
162
|
+
return function ( eventName, fn, options) {
|
|
163
|
+
try {
|
|
164
|
+
if (isEventListenerObject(fn)) {
|
|
165
|
+
// ESlint disable explanation:
|
|
166
|
+
// First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would
|
|
167
|
+
// introduce a bug here, because bind returns a new function that doesn't have our
|
|
168
|
+
// flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.
|
|
169
|
+
// Without those flags, every call to addEventListener wraps the function again, causing a memory leak.
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
171
|
+
fn.handleEvent = wrap(fn.handleEvent, {
|
|
172
|
+
mechanism: {
|
|
173
|
+
data: {
|
|
174
|
+
handler: getFunctionName(fn),
|
|
175
|
+
target,
|
|
176
|
+
},
|
|
177
|
+
handled: false,
|
|
178
|
+
type: 'auto.browser.browserapierrors.handleEvent',
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
} catch {
|
|
183
|
+
// can sometimes get 'Permission denied to access property "handle Event'
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (integrationOptions.unregisterOriginalCallbacks) {
|
|
187
|
+
unregisterOriginalCallback(this, eventName, fn);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return original.apply(this, [
|
|
191
|
+
eventName,
|
|
192
|
+
wrap(fn, {
|
|
193
|
+
mechanism: {
|
|
194
|
+
data: {
|
|
195
|
+
handler: getFunctionName(fn),
|
|
196
|
+
target,
|
|
197
|
+
},
|
|
198
|
+
handled: false,
|
|
199
|
+
type: 'auto.browser.browserapierrors.addEventListener',
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
202
|
+
options,
|
|
203
|
+
]);
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
fill(proto, 'removeEventListener', function (originalRemoveEventListener)
|
|
208
|
+
|
|
209
|
+
{
|
|
210
|
+
return function ( eventName, fn, options) {
|
|
211
|
+
/**
|
|
212
|
+
* There are 2 possible scenarios here:
|
|
213
|
+
*
|
|
214
|
+
* 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
|
|
215
|
+
* method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
|
|
216
|
+
* as a pass-through, and call original `removeEventListener` with it.
|
|
217
|
+
*
|
|
218
|
+
* 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
|
|
219
|
+
* our wrapped version of `addEventListener`, which internally calls `wrap` helper.
|
|
220
|
+
* This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
|
|
221
|
+
* in order for us to make a distinction between wrapped/non-wrapped functions possible.
|
|
222
|
+
* If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
|
|
223
|
+
*
|
|
224
|
+
* When someone adds a handler prior to initialization, and then do it again, but after,
|
|
225
|
+
* then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
|
|
226
|
+
* to get rid of the initial handler and it'd stick there forever.
|
|
227
|
+
*/
|
|
228
|
+
try {
|
|
229
|
+
const originalEventHandler = (fn ).__sentry_wrapped__;
|
|
230
|
+
if (originalEventHandler) {
|
|
231
|
+
originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
|
|
232
|
+
}
|
|
233
|
+
} catch {
|
|
234
|
+
// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
|
|
235
|
+
}
|
|
236
|
+
return originalRemoveEventListener.call(this, eventName, fn, options);
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function isEventListenerObject(obj) {
|
|
242
|
+
return typeof (obj ).handleEvent === 'function';
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function unregisterOriginalCallback(target, eventName, fn) {
|
|
246
|
+
if (
|
|
247
|
+
target &&
|
|
248
|
+
typeof target === 'object' &&
|
|
249
|
+
'removeEventListener' in target &&
|
|
250
|
+
typeof target.removeEventListener === 'function'
|
|
251
|
+
) {
|
|
252
|
+
target.removeEventListener(eventName, fn);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export { browserApiErrorsIntegration };
|
|
257
|
+
//# sourceMappingURL=browserapierrors.js.map
|