@sentry/browser 11.0.0-rc.0 → 11.0.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.
Files changed (81) hide show
  1. package/build/npm/cjs/dev/helpers.js +24 -2
  2. package/build/npm/cjs/dev/helpers.js.map +1 -1
  3. package/build/npm/cjs/dev/index.js +0 -1
  4. package/build/npm/cjs/dev/index.js.map +1 -1
  5. package/build/npm/cjs/dev/integrations/globalhandlers.js +2 -1
  6. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  7. package/build/npm/cjs/dev/integrations/httpclient.js +3 -12
  8. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  9. package/build/npm/cjs/dev/integrations/httpcontext.js +6 -0
  10. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  11. package/build/npm/cjs/dev/integrations/spotlight.js +4 -1
  12. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  13. package/build/npm/cjs/dev/integrations/webVitals.js.map +1 -1
  14. package/build/npm/cjs/dev/integrations/webWorker.js +73 -19
  15. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  16. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +1 -1
  17. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  18. package/build/npm/cjs/prod/helpers.js +24 -2
  19. package/build/npm/cjs/prod/helpers.js.map +1 -1
  20. package/build/npm/cjs/prod/index.js +0 -1
  21. package/build/npm/cjs/prod/index.js.map +1 -1
  22. package/build/npm/cjs/prod/integrations/globalhandlers.js +2 -1
  23. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  24. package/build/npm/cjs/prod/integrations/httpclient.js +3 -12
  25. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  26. package/build/npm/cjs/prod/integrations/httpcontext.js +6 -0
  27. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  28. package/build/npm/cjs/prod/integrations/spotlight.js +4 -1
  29. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  30. package/build/npm/cjs/prod/integrations/webVitals.js.map +1 -1
  31. package/build/npm/cjs/prod/integrations/webWorker.js +73 -19
  32. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  33. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +1 -1
  34. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  35. package/build/npm/esm/dev/helpers.js +24 -3
  36. package/build/npm/esm/dev/helpers.js.map +1 -1
  37. package/build/npm/esm/dev/index.js +1 -1
  38. package/build/npm/esm/dev/integrations/globalhandlers.js +2 -2
  39. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  40. package/build/npm/esm/dev/integrations/httpclient.js +3 -12
  41. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  42. package/build/npm/esm/dev/integrations/httpcontext.js +6 -0
  43. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  44. package/build/npm/esm/dev/integrations/spotlight.js +4 -1
  45. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  46. package/build/npm/esm/dev/integrations/webVitals.js.map +1 -1
  47. package/build/npm/esm/dev/integrations/webWorker.js +77 -23
  48. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  49. package/build/npm/esm/dev/package.json +1 -1
  50. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +1 -1
  51. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  52. package/build/npm/esm/prod/helpers.js +24 -3
  53. package/build/npm/esm/prod/helpers.js.map +1 -1
  54. package/build/npm/esm/prod/index.js +1 -1
  55. package/build/npm/esm/prod/integrations/globalhandlers.js +2 -2
  56. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  57. package/build/npm/esm/prod/integrations/httpclient.js +3 -12
  58. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  59. package/build/npm/esm/prod/integrations/httpcontext.js +6 -0
  60. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  61. package/build/npm/esm/prod/integrations/spotlight.js +4 -1
  62. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  63. package/build/npm/esm/prod/integrations/webVitals.js.map +1 -1
  64. package/build/npm/esm/prod/integrations/webWorker.js +77 -23
  65. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  66. package/build/npm/esm/prod/package.json +1 -1
  67. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +1 -1
  68. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  69. package/build/npm/types/exports.d.ts +1 -1
  70. package/build/npm/types/exports.d.ts.map +1 -1
  71. package/build/npm/types/helpers.d.ts +10 -2
  72. package/build/npm/types/helpers.d.ts.map +1 -1
  73. package/build/npm/types/integrations/globalhandlers.d.ts +4 -0
  74. package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
  75. package/build/npm/types/integrations/httpcontext.d.ts.map +1 -1
  76. package/build/npm/types/integrations/spotlight.d.ts +9 -2
  77. package/build/npm/types/integrations/spotlight.d.ts.map +1 -1
  78. package/build/npm/types/integrations/webVitals.d.ts +1 -1
  79. package/build/npm/types/integrations/webWorker.d.ts +5 -4
  80. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  81. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"webWorker.js","sources":["../../../../../src/integrations/webWorker.ts"],"sourcesContent":["import type { DebugImage, Integration, IntegrationFn } from '@sentry/core';\nimport { captureEvent, debug, defineIntegration, getClient, isPlainObject, isPrimitive } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { WINDOW } from '../helpers';\nimport { _eventFromRejectionWithPrimitive, _getUnhandledRejectionError } from './globalhandlers';\n\nexport const INTEGRATION_NAME = 'WebWorker' as const;\n\ninterface WebWorkerMessage {\n _sentryMessage: boolean;\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n _sentryWorkerError?: SerializedWorkerError;\n _sentryWasmImages?: Array<DebugImage>;\n}\n\ninterface SerializedWorkerError {\n reason: unknown;\n filename?: string;\n}\n\ninterface WebWorkerIntegrationOptions {\n worker: Worker | Array<Worker>;\n}\n\ninterface WebWorkerIntegration extends Integration {\n addWorker: (worker: Worker) => void;\n}\n\n/**\n * Use this integration to set up Sentry with web workers.\n *\n * IMPORTANT: This integration must be added **before** you start listening to\n * any messages from the worker. Otherwise, your message handlers will receive\n * messages from the Sentry SDK which you need to ignore.\n *\n * This integration only has an effect, if you call `Sentry.registerWebWorker(self)`\n * from within the worker(s) you're adding to the integration.\n *\n * Given that you want to initialize the SDK as early as possible, you most likely\n * want to add this integration **after** initializing the SDK:\n *\n * @example:\n * ```ts filename={main.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // some time earlier:\n * Sentry.init(...)\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Add the integration\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker });\n * Sentry.addIntegration(webWorkerIntegration);\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * If you initialize multiple workers at the same time, you can also pass an array of workers\n * to the integration:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: [worker1, worker2] });\n * Sentry.addIntegration(webWorkerIntegration);\n * ```\n *\n * If you have any additional workers that you initialize at a later point,\n * you can add them to the integration as follows:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: worker1 });\n * Sentry.addIntegration(webWorkerIntegration);\n *\n * // sometime later:\n * webWorkerIntegration.addWorker(worker2);\n * ```\n *\n * Of course, you can also directly add the integration in Sentry.init:\n * ```ts filename={main.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Initialize the SDK\n * Sentry.init({\n * integrations: [Sentry.webWorkerIntegration({ worker })]\n * });\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * @param options {WebWorkerIntegrationOptions} Integration options:\n * - `worker`: The worker instance.\n */\nexport const webWorkerIntegration = defineIntegration(({ worker }: WebWorkerIntegrationOptions) => ({\n name: INTEGRATION_NAME,\n setupOnce: () => {\n (Array.isArray(worker) ? worker : [worker]).forEach(w => listenForSentryMessages(w));\n },\n addWorker: (worker: Worker) => listenForSentryMessages(worker),\n})) as IntegrationFn<WebWorkerIntegration>;\n\nfunction listenForSentryMessages(worker: Worker): void {\n worker.addEventListener('message', event => {\n if (isSentryMessage(event.data)) {\n event.stopImmediatePropagation(); // other listeners should not receive this message\n\n // Handle debug IDs\n if (event.data._sentryDebugIds) {\n DEBUG_BUILD && debug.log('Sentry debugId web worker message received', event.data);\n WINDOW._sentryDebugIds = {\n ...event.data._sentryDebugIds,\n // debugIds of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryDebugIds,\n };\n }\n\n // Handle module metadata\n if (event.data._sentryModuleMetadata) {\n DEBUG_BUILD && debug.log('Sentry module metadata web worker message received', event.data);\n // Merge worker's raw metadata into the global object\n // It will be parsed lazily when needed by getMetadataForUrl\n WINDOW._sentryModuleMetadata = {\n ...event.data._sentryModuleMetadata,\n // Module metadata of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryModuleMetadata,\n };\n }\n\n // Handle WASM images from worker\n if (event.data._sentryWasmImages) {\n DEBUG_BUILD && debug.log('Sentry WASM images web worker message received', event.data);\n const existingImages =\n (WINDOW as typeof WINDOW & { _sentryWasmImages?: Array<DebugImage> })._sentryWasmImages || [];\n const newImages = event.data._sentryWasmImages.filter(\n (newImg: unknown) =>\n isPlainObject(newImg) &&\n typeof newImg.code_file === 'string' &&\n !existingImages.some(existing => existing.code_file === newImg.code_file),\n );\n (WINDOW as typeof WINDOW & { _sentryWasmImages?: Array<DebugImage> })._sentryWasmImages = [\n ...existingImages,\n ...newImages,\n ];\n }\n\n // Handle unhandled rejections forwarded from worker\n if (event.data._sentryWorkerError) {\n DEBUG_BUILD && debug.log('Sentry worker rejection message received', event.data._sentryWorkerError);\n handleForwardedWorkerRejection(event.data._sentryWorkerError);\n }\n }\n });\n}\n\nfunction handleForwardedWorkerRejection(workerError: SerializedWorkerError): void {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const stackParser = client.getOptions().stackParser;\n const attachStacktrace = client.getOptions().attachStacktrace;\n\n const error = workerError.reason;\n\n // Follow same pattern as globalHandlers for unhandledrejection\n // Handle both primitives and errors the same way\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n // Add worker-specific context\n if (workerError.filename) {\n event.contexts = {\n ...event.contexts,\n worker: {\n filename: workerError.filename,\n },\n };\n }\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.web_worker.onunhandledrejection',\n },\n });\n\n DEBUG_BUILD && debug.log('Captured worker unhandled rejection', error);\n}\n\n/**\n * Minimal interface for DedicatedWorkerGlobalScope, only requiring the postMessage method.\n * (which is the only thing we need from the worker's global object)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope\n *\n * We can't use the actual type because it breaks everyone who doesn't have {\"lib\": [\"WebWorker\"]}\n * but uses {\"skipLibCheck\": true} in their tsconfig.json.\n */\ninterface MinimalDedicatedWorkerGlobalScope {\n postMessage: (message: unknown) => void;\n addEventListener: (type: string, listener: (event: unknown) => void) => void;\n location?: { href?: string };\n}\n\ninterface RegisterWebWorkerOptions {\n self: MinimalDedicatedWorkerGlobalScope & {\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n };\n}\n\n/**\n * Use this function to register the worker with the Sentry SDK.\n *\n * This function will:\n * - Send debug IDs to the parent thread\n * - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)\n * - Set up a handler for unhandled rejections in the worker\n * - Forward unhandled rejections to the parent thread for capture\n *\n * Note: Synchronous errors in workers are already captured by globalHandlers.\n * This only handles unhandled promise rejections which don't bubble to the parent.\n *\n * @example\n * ```ts filename={worker.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // Do this as early as possible in your worker.\n * Sentry.registerWebWorker({ self });\n *\n * // continue setting up your worker\n * self.postMessage(...)\n * ```\n * @param options {RegisterWebWorkerOptions} Integration options:\n * - `self`: The worker instance you're calling this function from (self).\n */\nexport function registerWebWorker({ self }: RegisterWebWorkerOptions): void {\n // Send debug IDs and raw module metadata to parent thread\n // The metadata will be parsed lazily on the main thread when needed\n self.postMessage({\n _sentryMessage: true,\n _sentryDebugIds: self._sentryDebugIds ?? undefined,\n _sentryModuleMetadata: self._sentryModuleMetadata ?? undefined,\n });\n\n // Set up unhandledrejection handler inside the worker\n // Following the same pattern as globalHandlers\n // unhandled rejections don't bubble to the parent thread, so we need to handle them here\n self.addEventListener('unhandledrejection', (event: unknown) => {\n const reason = _getUnhandledRejectionError(event);\n\n // Forward the raw reason to parent thread\n // The parent will handle primitives vs errors the same way globalHandlers does\n const serializedError: SerializedWorkerError = {\n reason: reason,\n filename: self.location?.href,\n };\n\n // Forward to parent thread\n self.postMessage({\n _sentryMessage: true,\n _sentryWorkerError: serializedError,\n });\n\n DEBUG_BUILD && debug.log('[Sentry Worker] Forwarding unhandled rejection to parent', serializedError);\n });\n\n DEBUG_BUILD && debug.log('[Sentry Worker] Registered worker with unhandled rejection handling');\n}\n\nfunction isSentryMessage(eventData: unknown): eventData is WebWorkerMessage {\n if (!isPlainObject(eventData) || eventData._sentryMessage !== true) {\n return false;\n }\n\n // Must have at least one of: debug IDs, module metadata, worker error, or WASM images\n const hasDebugIds = '_sentryDebugIds' in eventData;\n const hasModuleMetadata = '_sentryModuleMetadata' in eventData;\n const hasWorkerError = '_sentryWorkerError' in eventData;\n const hasWasmImages = '_sentryWasmImages' in eventData;\n\n if (!hasDebugIds && !hasModuleMetadata && !hasWorkerError && !hasWasmImages) {\n return false;\n }\n\n // Validate debug IDs if present\n if (hasDebugIds && !(isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === undefined)) {\n return false;\n }\n\n // Validate module metadata if present\n if (\n hasModuleMetadata &&\n !(isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === undefined)\n ) {\n return false;\n }\n\n // Validate worker error if present\n if (hasWorkerError && !isPlainObject(eventData._sentryWorkerError)) {\n return false;\n }\n\n // Validate WASM images if present\n if (\n hasWasmImages &&\n (!Array.isArray(eventData._sentryWasmImages) ||\n !eventData._sentryWasmImages.every(\n (img: unknown) => isPlainObject(img) && typeof (img as { code_file?: unknown }).code_file === 'string',\n ))\n ) {\n return false;\n }\n\n return true;\n}\n"],"names":["worker"],"mappings":";;;;;;AAOO,MAAM,gBAAA,GAAmB;AAgGzB,MAAM,oBAAA,GAAuB,iBAAA,CAAkB,CAAC,EAAE,QAAO,MAAoC;AAAA,EAClG,IAAA,EAAM,gBAAA;AAAA,EACN,WAAW,MAAM;AACf,IAAA,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,GAAI,MAAA,GAAS,CAAC,MAAM,CAAA,EAAG,OAAA,CAAQ,CAAA,CAAA,KAAK,uBAAA,CAAwB,CAAC,CAAC,CAAA;AAAA,EACrF,CAAA;AAAA,EACA,SAAA,EAAW,CAACA,OAAAA,KAAmB,uBAAA,CAAwBA,OAAM;AAC/D,CAAA,CAAE;AAEF,SAAS,wBAAwB,MAAA,EAAsB;AACrD,EAAA,MAAA,CAAO,gBAAA,CAAiB,WAAW,CAAA,KAAA,KAAS;AAC1C,IAAA,IAAI,eAAA,CAAgB,KAAA,CAAM,IAAI,CAAA,EAA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AAY;AACzG,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IACE,iBAAA,IACA,EAAE,aAAA,CAAc,SAAA,CAAU,qBAAqB,CAAA,IAAK,SAAA,CAAU,0BAA0B,MAAA,CAAA,EACxF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IAAI,cAAA,IAAkB,CAAC,aAAA,CAAc,SAAA,CAAU,kBAAkB,CAAA,EAAG;AAClE,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IACE,aAAA,KACC,CAAC,KAAA,CAAM,OAAA,CAAQ,UAAU,iBAAiB,CAAA,IACzC,CAAC,SAAA,CAAU,iBAAA,CAAkB,KAAA;AAAA,IAC3B,CAAC,GAAA,KAAiB,aAAA,CAAc,GAAG,CAAA,IAAK,OAAQ,IAAgC,SAAA,KAAc;AAAA,GAChG,CAAA,EACF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
1
+ {"version":3,"file":"webWorker.js","sources":["../../../../../src/integrations/webWorker.ts"],"sourcesContent":["import type { DebugImage, Integration, IntegrationFn } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n captureEvent,\n debug,\n defineIntegration,\n getClient,\n isError,\n isPlainObject,\n isPrimitive,\n normalize,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput, extractMessage, extractType } from '../eventbuilder';\nimport { ignoreNextOnErrorMatching, WINDOW } from '../helpers';\nimport {\n _enhanceEventWithInitialFrame,\n _eventFromRejectionWithPrimitive,\n _getUnhandledRejectionError,\n} from './globalhandlers';\n\nexport const INTEGRATION_NAME = 'WebWorker' as const;\n\nconst MAX_FORWARDED_ERRORS = 20;\n\ninterface WebWorkerMessage {\n _sentryMessage: boolean;\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n _sentryWorkerError?: SerializedWorkerError;\n _sentryWasmImages?: Array<DebugImage>;\n}\n\ntype WorkerErrorKind = 'error' | 'unhandledrejection';\n\ninterface SerializedWorkerError {\n reason: unknown;\n filename?: string;\n /** Absent on workers registered by an SDK version that only forwarded rejections. */\n kind?: WorkerErrorKind;\n /** Structured clone resets any name outside the built-in set to `Error`. */\n name?: string;\n /** The `ErrorEvent` message, matched against the copy that bubbles to `window.onerror`. */\n message?: string;\n /** Script the error was thrown in, which can differ from the worker script. */\n url?: string;\n lineno?: number;\n colno?: number;\n /** Set when `reason` is a plain `{ message, stack }` copy of an error that did not clone. */\n plainError?: boolean;\n}\n\ninterface WebWorkerIntegrationOptions {\n worker: Worker | Array<Worker>;\n}\n\ninterface WebWorkerIntegration extends Integration {\n addWorker: (worker: Worker) => void;\n}\n\n/**\n * Use this integration to set up Sentry with web workers.\n *\n * IMPORTANT: This integration must be added **before** you start listening to\n * any messages from the worker. Otherwise, your message handlers will receive\n * messages from the Sentry SDK which you need to ignore.\n *\n * This integration only has an effect, if you call `Sentry.registerWebWorker(self)`\n * from within the worker(s) you're adding to the integration.\n *\n * Given that you want to initialize the SDK as early as possible, you most likely\n * want to add this integration **after** initializing the SDK:\n *\n * @example:\n * ```ts filename={main.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // some time earlier:\n * Sentry.init(...)\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Add the integration\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker });\n * Sentry.addIntegration(webWorkerIntegration);\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * If you initialize multiple workers at the same time, you can also pass an array of workers\n * to the integration:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: [worker1, worker2] });\n * Sentry.addIntegration(webWorkerIntegration);\n * ```\n *\n * If you have any additional workers that you initialize at a later point,\n * you can add them to the integration as follows:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: worker1 });\n * Sentry.addIntegration(webWorkerIntegration);\n *\n * // sometime later:\n * webWorkerIntegration.addWorker(worker2);\n * ```\n *\n * Of course, you can also directly add the integration in Sentry.init:\n * ```ts filename={main.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Initialize the SDK\n * Sentry.init({\n * integrations: [Sentry.webWorkerIntegration({ worker })]\n * });\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * @param options {WebWorkerIntegrationOptions} Integration options:\n * - `worker`: The worker instance.\n */\nexport const webWorkerIntegration = defineIntegration(({ worker }: WebWorkerIntegrationOptions) => ({\n name: INTEGRATION_NAME,\n setupOnce: () => {\n (Array.isArray(worker) ? worker : [worker]).forEach(w => listenForSentryMessages(w));\n },\n addWorker: (worker: Worker) => listenForSentryMessages(worker),\n})) as IntegrationFn<WebWorkerIntegration>;\n\nfunction listenForSentryMessages(worker: Worker): void {\n // Forwarded errors whose message-only copy has yet to bubble to the page.\n const forwardedErrors: Array<Pick<SerializedWorkerError, 'message' | 'url' | 'lineno' | 'colno'>> = [];\n\n // The bubbled copy fires `error` on the worker object and then `window.onerror` in the same task, after the\n // forward arrived. Skipping only copies of errors we actually received means a missing forward can at worst\n // cause a duplicate, never a lost error.\n worker.addEventListener('error', ({ message, filename, lineno, colno }) => {\n const index = forwardedErrors.findIndex(\n e => e.message === message && e.url === filename && e.lineno === lineno && e.colno === colno,\n );\n if (index !== -1) {\n // Earlier entries were cancelled inside the worker and will never bubble.\n forwardedErrors.splice(0, index + 1);\n ignoreNextOnErrorMatching({ msg: message, url: filename, line: lineno, column: colno });\n }\n });\n\n worker.addEventListener('message', event => {\n if (isSentryMessage(event.data)) {\n event.stopImmediatePropagation(); // other listeners should not receive this message\n\n // Handle debug IDs\n if (event.data._sentryDebugIds) {\n DEBUG_BUILD && debug.log('Sentry debugId web worker message received', event.data);\n WINDOW._sentryDebugIds = {\n ...event.data._sentryDebugIds,\n // debugIds of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryDebugIds,\n };\n }\n\n // Handle module metadata\n if (event.data._sentryModuleMetadata) {\n DEBUG_BUILD && debug.log('Sentry module metadata web worker message received', event.data);\n // Merge worker's raw metadata into the global object\n // It will be parsed lazily when needed by getMetadataForUrl\n WINDOW._sentryModuleMetadata = {\n ...event.data._sentryModuleMetadata,\n // Module metadata of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryModuleMetadata,\n };\n }\n\n // Handle WASM images from worker\n if (event.data._sentryWasmImages) {\n DEBUG_BUILD && debug.log('Sentry WASM images web worker message received', event.data);\n const existingImages =\n (WINDOW as typeof WINDOW & { _sentryWasmImages?: Array<DebugImage> })._sentryWasmImages || [];\n const newImages = event.data._sentryWasmImages.filter(\n (newImg: unknown) =>\n isPlainObject(newImg) &&\n typeof newImg.code_file === 'string' &&\n !existingImages.some(existing => existing.code_file === newImg.code_file),\n );\n (WINDOW as typeof WINDOW & { _sentryWasmImages?: Array<DebugImage> })._sentryWasmImages = [\n ...existingImages,\n ...newImages,\n ];\n }\n\n // Handle errors and unhandled rejections forwarded from worker\n if (event.data._sentryWorkerError) {\n DEBUG_BUILD && debug.log('Sentry worker error message received', event.data._sentryWorkerError);\n const { kind, message, url, lineno, colno } = event.data._sentryWorkerError;\n if (kind === 'error') {\n // Bounded because a worker that cancels its own errors never bubbles them.\n if (forwardedErrors.push({ message, url, lineno, colno }) > MAX_FORWARDED_ERRORS) {\n forwardedErrors.shift();\n }\n }\n handleForwardedWorkerError(event.data._sentryWorkerError);\n }\n }\n });\n}\n\nfunction handleForwardedWorkerError(workerError: SerializedWorkerError): void {\n const { reason, kind, name, filename, url, lineno, colno, plainError } = workerError;\n // Older workers only ever forwarded rejections and send no `kind`.\n const isUnhandledRejection = kind !== 'error';\n\n const error = plainError && isPlainObject(reason) ? errorFromPlain(reason) : reason;\n\n if (name && isError(error) && error.name !== name) {\n addNonEnumerableProperty(error, 'name', name);\n }\n\n const client = getClient();\n if (!client) {\n return;\n }\n\n const { stackParser, attachStacktrace } = client.getOptions();\n\n // Follow same pattern as globalHandlers for each source.\n // A thrown primitive is not a rejection, so the rejection-specific wording must not apply to it.\n const event =\n isUnhandledRejection && isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, isUnhandledRejection);\n\n if (!isUnhandledRejection) {\n // An ErrorEvent reports an unknown script as an empty string.\n _enhanceEventWithInitialFrame(event, url || filename, lineno, colno);\n }\n\n event.level = 'error';\n\n // Add worker-specific context\n if (filename) {\n event.contexts = {\n ...event.contexts,\n worker: {\n filename,\n },\n };\n }\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: isUnhandledRejection ? 'auto.browser.web_worker.onunhandledrejection' : 'auto.browser.web_worker.onerror',\n },\n });\n\n DEBUG_BUILD && debug.log(`Captured worker ${isUnhandledRejection ? 'unhandled rejection' : 'error'}`, error);\n}\n\n/**\n * Minimal interface for DedicatedWorkerGlobalScope, only requiring the postMessage method.\n * (which is the only thing we need from the worker's global object)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope\n *\n * We can't use the actual type because it breaks everyone who doesn't have {\"lib\": [\"WebWorker\"]}\n * but uses {\"skipLibCheck\": true} in their tsconfig.json.\n */\ninterface MinimalDedicatedWorkerGlobalScope {\n postMessage: (message: unknown) => void;\n addEventListener: (type: string, listener: (event: unknown) => void) => void;\n location?: { href?: string };\n}\n\ninterface RegisterWebWorkerOptions {\n self: MinimalDedicatedWorkerGlobalScope & {\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n };\n}\n\n/**\n * Use this function to register the worker with the Sentry SDK.\n *\n * This function will:\n * - Send debug IDs to the parent thread\n * - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)\n * - Set up handlers for uncaught errors and unhandled rejections in the worker\n * - Forward both to the parent thread for capture\n *\n * Note: uncaught errors do bubble to the parent, but the propagated `ErrorEvent` carries\n * no `error` object, so globalHandlers can only build an event from the message string.\n * Forwarding them here preserves the real stack, which matters most for wasm frames.\n *\n * @example\n * ```ts filename={worker.js}\n * import * as Sentry from '@sentry/<your-sdk>';\n *\n * // Do this as early as possible in your worker.\n * Sentry.registerWebWorker({ self });\n *\n * // continue setting up your worker\n * self.postMessage(...)\n * ```\n * @param options {RegisterWebWorkerOptions} Integration options:\n * - `self`: The worker instance you're calling this function from (self).\n */\nexport function registerWebWorker({ self }: RegisterWebWorkerOptions): void {\n // Mirrors globalHandlersIntegration. The worker has no client of its own, so without this\n // V8's default of 10 truncates stacks before this code forwards them.\n Error.stackTraceLimit = 50;\n\n // Send debug IDs and raw module metadata to parent thread\n // The metadata will be parsed lazily on the main thread when needed\n self.postMessage({\n _sentryMessage: true,\n _sentryDebugIds: self._sentryDebugIds ?? undefined,\n _sentryModuleMetadata: self._sentryModuleMetadata ?? undefined,\n });\n\n const forward = (serializedError: Omit<SerializedWorkerError, 'filename' | 'name'>): void => {\n const { reason } = serializedError;\n\n DEBUG_BUILD && debug.log(`[Sentry Worker] Forwarding ${serializedError.kind} to parent`, serializedError);\n\n postSerializedWorkerError(self, {\n ...serializedError,\n filename: self.location?.href,\n name: isError(reason) ? extractType(reason) : undefined,\n });\n };\n\n // Uncaught errors bubble to the parent, but the propagated ErrorEvent\n // carries no error object. Forwarding the object keeps the real stack.\n self.addEventListener('error', (event: unknown) => {\n const { error, message, filename, lineno, colno } = event as {\n error?: unknown;\n message?: string;\n filename?: string;\n lineno?: number;\n colno?: number;\n };\n\n forward({ kind: 'error', reason: error ?? message, message, url: filename, lineno, colno });\n });\n\n // Unhandled rejections do not bubble to the parent thread at all.\n self.addEventListener('unhandledrejection', (event: unknown) => {\n forward({ kind: 'unhandledrejection', reason: _getUnhandledRejectionError(event) });\n });\n\n DEBUG_BUILD && debug.log('[Sentry Worker] Registered worker with error and unhandled rejection handling');\n}\n\n/**\n * `postMessage` structured-clones the reason. A `DataCloneError` must never\n * escape the worker's own error handler, so the forward is retried with\n * plain data that clones in every browser, including ones that cannot clone\n * `Error` at all.\n */\nfunction postSerializedWorkerError(\n self: MinimalDedicatedWorkerGlobalScope,\n serializedError: SerializedWorkerError,\n): void {\n try {\n self.postMessage({\n _sentryMessage: true,\n _sentryWorkerError: serializedError,\n });\n return;\n } catch {\n // Not cloneable, fall through and send plain data instead.\n }\n\n const { reason } = serializedError;\n const plainError = isError(reason);\n const plainReason = plainError ? { message: extractMessage(reason), stack: reason.stack } : normalize(reason);\n\n try {\n self.postMessage({\n _sentryMessage: true,\n _sentryWorkerError: { ...serializedError, reason: plainReason, plainError },\n });\n } catch {\n // Dropping the forward is better than throwing out of the worker's error handler.\n }\n}\n\nfunction errorFromPlain(plain: Record<string, unknown>): Error {\n const error = new Error(String(plain.message));\n error.stack = typeof plain.stack === 'string' ? plain.stack : undefined;\n return error;\n}\n\nfunction isSentryMessage(eventData: unknown): eventData is WebWorkerMessage {\n if (!isPlainObject(eventData) || eventData._sentryMessage !== true) {\n return false;\n }\n\n // Must have at least one of: debug IDs, module metadata, worker error, or WASM images\n const hasDebugIds = '_sentryDebugIds' in eventData;\n const hasModuleMetadata = '_sentryModuleMetadata' in eventData;\n const hasWorkerError = '_sentryWorkerError' in eventData;\n const hasWasmImages = '_sentryWasmImages' in eventData;\n\n if (!hasDebugIds && !hasModuleMetadata && !hasWorkerError && !hasWasmImages) {\n return false;\n }\n\n // Validate debug IDs if present\n if (hasDebugIds && !(isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === undefined)) {\n return false;\n }\n\n // Validate module metadata if present\n if (\n hasModuleMetadata &&\n !(isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === undefined)\n ) {\n return false;\n }\n\n // Validate worker error if present\n if (hasWorkerError && !isPlainObject(eventData._sentryWorkerError)) {\n return false;\n }\n\n // Validate WASM images if present\n if (\n hasWasmImages &&\n (!Array.isArray(eventData._sentryWasmImages) ||\n !eventData._sentryWasmImages.every(\n (img: unknown) => isPlainObject(img) && typeof (img as { code_file?: unknown }).code_file === 'string',\n ))\n ) {\n return false;\n }\n\n return true;\n}\n"],"names":["worker"],"mappings":";;;;;;AAqBO,MAAM,gBAAA,GAAmB;AAEhC,MAAM,oBAAA,GAAuB,EAAA;AA8GtB,MAAM,oBAAA,GAAuB,iBAAA,CAAkB,CAAC,EAAE,QAAO,MAAoC;AAAA,EAClG,IAAA,EAAM,gBAAA;AAAA,EACN,WAAW,MAAM;AACf,IAAA,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,GAAI,MAAA,GAAS,CAAC,MAAM,CAAA,EAAG,OAAA,CAAQ,CAAA,CAAA,KAAK,uBAAA,CAAwB,CAAC,CAAC,CAAA;AAAA,EACrF,CAAA;AAAA,EACA,SAAA,EAAW,CAACA,OAAAA,KAAmB,uBAAA,CAAwBA,OAAM;AAC/D,CAAA,CAAE;AAEF,SAAS,wBAAwB,MAAA,EAAsB;AAErD,EAAA,MAAM,kBAA8F,EAAC;AAKrG,EAAA,MAAA,CAAO,gBAAA,CAAiB,SAAS,CAAC,EAAE,SAAS,QAAA,EAAU,MAAA,EAAQ,OAAM,KAAM;AACzE,IAAA,MAAM,QAAQ,eAAA,CAAgB,SAAA;AAAA,MAC5B,CAAA,CAAA,KAAK,CAAA,CAAE,OAAA,KAAY,OAAA,IAAW,CAAA,CAAE,GAAA,KAAQ,QAAA,IAAY,CAAA,CAAE,MAAA,KAAW,MAAA,IAAU,CAAA,CAAE,KAAA,KAAU;AAAA,KACzF;AACA,IAAA,IAAI,UAAU,EAAA,EAAI;AAEhB,MAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,EAAG,KAAA,GAAQ,CAAC,CAAA;AACnC,MAAA,yBAAA,CAA0B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AA,EACT;AAGA,EAAA,IAAI,WAAA,IAAe,EAAE,aAAA,CAAc,SAAA,CAAU,eAAe,CAAA,IAAK,SAAA,CAAU,oBAAoB,MAAA,CAAA,EAAY;AACzG,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IACE,iBAAA,IACA,EAAE,aAAA,CAAc,SAAA,CAAU,qBAAqB,CAAA,IAAK,SAAA,CAAU,0BAA0B,MAAA,CAAA,EACxF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IAAI,cAAA,IAAkB,CAAC,aAAA,CAAc,SAAA,CAAU,kBAAkB,CAAA,EAAG;AAClE,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IACE,aAAA,KACC,CAAC,KAAA,CAAM,OAAA,CAAQ,UAAU,iBAAiB,CAAA,IACzC,CAAC,SAAA,CAAU,iBAAA,CAAkB,KAAA;AAAA,IAC3B,CAAC,GAAA,KAAiB,aAAA,CAAc,GAAG,CAAA,IAAK,OAAQ,IAAgC,SAAA,KAAc;AAAA,GAChG,CAAA,EACF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"11.0.0-rc.0","sideEffects":false}
1
+ {"type":"module","version":"11.0.0","sideEffects":false}
@@ -318,7 +318,7 @@ const browserTracingIntegration = ((options = {}) => {
318
318
  [SENTRY_ORIGIN]: "auto.navigation.browser.bfcache",
319
319
  // A bfcache restore is near-instant, so these spans would otherwise drag
320
320
  // navigation duration percentiles down with no way to tell them apart.
321
- [BROWSER_NAVIGATION_TYPE]: "bfcache"
321
+ [BROWSER_NAVIGATION_TYPE]: "back-forward-cache"
322
322
  }
323
323
  },
324
324
  { url: WINDOW.location?.href }
@@ -1 +1 @@
1
- {"version":3,"file":"browserTracingIntegration.js","sources":["../../../../../src/tracing/browserTracingIntegration.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Client, IntegrationFn, RequestHookInfo, ResponseHookInfo, Span, StartSpanOptions } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n consoleSandbox,\n dateTimestampInSeconds,\n debug,\n generateSpanId,\n generateTraceId,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromSpan,\n GLOBAL_OBJ,\n hasSpansEnabled,\n hasSpanStreamingEnabled,\n NAVIGATION_SPAN_NAME_FALLBACK,\n PAGELOAD_SPAN_NAME_FALLBACK,\n isURLObjectRelative,\n parseStringToURLObject,\n propagationContextFromHeaders,\n registerSpanErrorInstrumentation,\n spanIsSampled,\n spanToJSON,\n timestampInSeconds,\n TRACING_DEFAULTS,\n browserPerformanceTimeOrigin,\n} from '@sentry/core';\nimport { _INTERNAL_ensureBrowserSpanStreaming, startIdleSpan, startInactiveSpan } from '@sentry/core/browser';\nimport {\n addHistoryInstrumentationHandler,\n addPerformanceEntries,\n getLocationHref,\n isBotUserAgent,\n startTrackingLongAnimationFrames,\n startTrackingLongTasks,\n} from '@sentry/browser-utils';\nimport { BROWSER_NAVIGATION_TYPE } from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { filterCollectedUrl } from '@sentry/core';\nimport { getHttpRequestData, WINDOW } from '../helpers';\nimport type { WebVitalsOptions } from '../integrations/webVitals';\nimport { WEB_VITALS_INTEGRATION_NAME, webVitalsIntegration } from '../integrations/webVitals';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport { linkTraces } from './linkedTraces';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n SENTRY_OP,\n URL_FULL,\n URL_PATH,\n SENTRY_ORIGIN,\n SENTRY_IDLE_SPAN_FINISH_REASON,\n} from '@sentry/conventions/attributes';\nimport { NAVIGATION, NAVIGATION_REDIRECT, PAGELOAD } from '@sentry/conventions/op';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * Default: 1000 (ms)\n */\n idleTimeout: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * Default: 30000 (ms)\n */\n finalTimeout: number;\n\n /**\n The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * Default: 15000 (ms)\n */\n childSpanTimeout: number;\n\n /**\n * If a span should be created on page load.\n * If this is set to `false`, this integration will not start the default page load span.\n * Default: true\n */\n instrumentPageLoad: boolean;\n\n /**\n * If a span should be created on navigation (history change).\n * If this is set to `false`, this integration will not start the default navigation spans.\n * Default: true\n */\n instrumentNavigation: boolean;\n\n /**\n * If a navigation span should be created when the page is restored from the back/forward cache.\n *\n * This is deliberately independent of {@link BrowserTracingOptions.instrumentNavigation}: a restore\n * is not a history change, and the framework integrations that own their own navigation spans turn\n * that option off without ever handling a restore. The point of this span is trace hygiene, keeping\n * everything after the restore off the trace the page had before it was frozen, so it is worth\n * having even where history instrumentation is not.\n *\n * Default: true\n */\n instrumentBfcacheRestore: boolean;\n\n /**\n * Flag spans where tabs moved to background with \"cancelled\". Browser background tab timing is\n * not suited towards doing precise measurements of operations. By default, we recommend that this option\n * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n *\n * Default: true\n */\n markBackgroundSpan: boolean;\n\n /**\n * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n *\n * Default: true\n */\n enableLongTask: boolean;\n\n /**\n * If true, Sentry will capture long animation frames and add them to the corresponding transaction.\n *\n * Default: false\n */\n enableLongAnimationFrame: boolean;\n\n /**\n * If true, Sentry will capture first input delay and add it to the corresponding transaction.\n *\n * Default: true\n *\n * @deprecated Use {@link BrowserTracingOptions.webVitals} instead: `webVitals: { ignore: ['inp'] }`.\n */\n enableInp: boolean;\n\n /**\n * Options for the `webVitalsIntegration` that is auto-registered when none is present.\n * Ignored if you register `webVitalsIntegration` yourself.\n */\n webVitals?: WebVitalsOptions;\n\n /**\n * @deprecated This option is no longer used. Element timing is now tracked via the standalone\n * `elementTimingIntegration`. Add it to your `integrations` array to collect element timing metrics.\n */\n enableElementTiming?: boolean;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * Default: true\n */\n enableHTTPTimings: boolean;\n\n /**\n * Resource spans with `op`s matching strings in the array will not be emitted.\n *\n * Default: []\n */\n ignoreResourceSpans: Array<'resource.script' | 'resource.css' | 'resource.img' | 'resource.other' | string>;\n\n /**\n * By default, the SDK will try to detect redirects and avoid creating separate spans for them.\n * If you want to opt-out of this behavior, you can set this option to `false`.\n *\n * Default: true\n */\n detectRedirects: boolean;\n\n /**\n * Link the currently started trace to a previous trace (e.g. a prior pageload, navigation or\n * manually started span). When enabled, this option will allow you to navigate between traces\n * in the Sentry UI.\n *\n * You can set this option to the following values:\n *\n * - `'in-memory'`: The previous trace data will be stored in memory.\n * This is useful for single-page applications and enabled by default.\n *\n * - `'session-storage'`: The previous trace data will be stored in the `sessionStorage`.\n * This is useful for multi-page applications or static sites but it means that the\n * Sentry SDK writes to the browser's `sessionStorage`.\n *\n * - `'off'`: The previous trace data will not be stored or linked.\n *\n * You can also use {@link BrowserTracingOptions.consistentTraceSampling} to get\n * consistent trace sampling of subsequent traces. Otherwise, by default, your\n * `tracesSampleRate` or `tracesSampler` config significantly influences how often\n * traces will be linked.\n *\n * @default 'in-memory' - see explanation above\n */\n linkPreviousTrace: 'in-memory' | 'session-storage' | 'off';\n\n /**\n * If true, Sentry will consistently sample subsequent traces based on the\n * sampling decision of the initial trace. For example, if the initial page\n * load trace was sampled positively, all subsequent traces (e.g. navigations)\n * are also sampled positively. In case the initial trace was sampled negatively,\n * all subsequent traces are also sampled negatively.\n *\n * This option allows you to get consistent, linked traces within a user journey\n * while maintaining an overall quota based on your trace sampling settings.\n *\n * This option is only effective if {@link BrowserTracingOptions.linkPreviousTrace}\n * is enabled (i.e. not set to `'off'`).\n *\n * @default `false` - this is an opt-in feature.\n */\n consistentTraceSampling: boolean;\n\n /**\n * If set to `true`, the pageload span will not end itself automatically, unless it\n * runs until the {@link BrowserTracingOptions.finalTimeout} (30 seconds by default) is reached.\n *\n * Set this option to `true`, if you want full control over the pageload span duration.\n * You can use `Sentry.reportPageLoaded()` to manually end the pageload span whenever convenient.\n * Be aware that you have to ensure that this is always called, regardless of the chosen route\n * or path in the application.\n *\n * @default `false`. By default, the pageload span will end itself automatically, based on\n * the {@link BrowserTracingOptions.finalTimeout}, {@link BrowserTracingOptions.idleTimeout}\n * and {@link BrowserTracingOptions.childSpanTimeout}. This is more convenient to use but means\n * that the pageload duration can be arbitrary and might not be fully representative of a perceived\n * page load time.\n */\n enableReportPageLoaded: boolean;\n\n /**\n * A callback which is called before a span for a pageload or navigation is started.\n * It receives the options passed to `startSpan`, and expects to return an updated options object.\n */\n beforeStartSpan?: (options: StartSpanOptions) => StartSpanOptions;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * Default: (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n\n /**\n * This callback is invoked directly after a span is started for an outgoing fetch or XHR request.\n * You can use it to annotate the span with additional data or attributes, for example by setting\n * attributes based on the passed request headers.\n */\n onRequestSpanStart?(span: Span, requestInformation: RequestHookInfo): void;\n\n /**\n * Is called when spans end for outgoing requests, providing access to response headers.\n */\n onRequestSpanEnd?(span: Span, responseInformation: ResponseHookInfo): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n ...TRACING_DEFAULTS,\n instrumentNavigation: true,\n instrumentBfcacheRestore: true,\n instrumentPageLoad: true,\n markBackgroundSpan: true,\n enableLongTask: true,\n enableLongAnimationFrame: true,\n // oxlint-disable-next-line typescript/no-deprecated -- still honoured until it is removed\n enableInp: true,\n ignoreResourceSpans: [],\n detectRedirects: true,\n linkPreviousTrace: 'in-memory',\n consistentTraceSampling: false,\n enableReportPageLoaded: false,\n ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library.\n *\n * We explicitly export the proper type here, as this has to be extended in some cases.\n */\nexport const browserTracingIntegration = ((options: Partial<BrowserTracingOptions> = {}) => {\n if ('enableElementTiming' in options) {\n consoleSandbox(() => {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.',\n );\n });\n }\n\n /**\n * This is just a small wrapper that makes `document` optional.\n * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.\n */\n const optionalWindowDocument = WINDOW.document as (typeof WINDOW)['document'] | undefined;\n\n const {\n // oxlint-disable-next-line typescript/no-deprecated -- still honoured until it is removed\n enableInp,\n enableLongTask,\n enableLongAnimationFrame,\n webVitals,\n beforeStartSpan,\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n markBackgroundSpan,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n ignoreResourceSpans,\n instrumentPageLoad,\n instrumentNavigation,\n instrumentBfcacheRestore,\n detectRedirects,\n linkPreviousTrace,\n consistentTraceSampling,\n enableReportPageLoaded,\n onRequestSpanStart,\n onRequestSpanEnd,\n } = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ...options,\n };\n\n const _isBot = isBotUserAgent();\n\n let lastInteractionTimestamp: number | undefined;\n\n let _pageloadSpan: Span | undefined;\n\n /** Create routing idle transaction. */\n function _createRouteSpan(client: Client, startSpanOptions: StartSpanOptions, makeActive = true, url?: string): void {\n const isPageloadSpan = startSpanOptions.op === 'pageload';\n\n const initialSpanName = startSpanOptions.name;\n const finalStartSpanOptions: StartSpanOptions = beforeStartSpan\n ? beforeStartSpan(startSpanOptions)\n : startSpanOptions;\n\n // For navigations, `url` is the destination URL, so we use it to reflect the post-navigation location.\n // For pageloads (and manual navigation spans without a URL) we fall back to the current location.\n const urlObject = parseStringToURLObject(url || getLocationHref());\n\n const attributes = {\n ...(urlObject?.pathname && { [URL_PATH]: urlObject.pathname }),\n ...(urlObject && !isURLObjectRelative(urlObject) && { [URL_FULL]: filterCollectedUrl(urlObject.href) }),\n ...finalStartSpanOptions.attributes,\n };\n\n // If `finalStartSpanOptions.name` is different than `startSpanOptions.name`\n // it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.\n if (initialSpanName !== finalStartSpanOptions.name) {\n attributes[SENTRY_SEGMENT_NAME_SOURCE] = 'custom';\n }\n\n finalStartSpanOptions.attributes = attributes;\n\n if (!makeActive) {\n // We want to ensure this has 0s duration\n const now = dateTimestampInSeconds();\n startInactiveSpan({\n ...finalStartSpanOptions,\n startTime: now,\n }).end(now);\n return;\n }\n\n const idleSpan = startIdleSpan(finalStartSpanOptions, {\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n // should wait for finish signal if it's a pageload transaction\n disableAutoFinish: isPageloadSpan,\n trimIdleSpanEndTimestamp: !enableReportPageLoaded,\n });\n\n if (isPageloadSpan && enableReportPageLoaded) {\n _pageloadSpan = idleSpan;\n }\n\n setActiveIdleSpan(client, idleSpan);\n\n function emitFinish(): void {\n if (optionalWindowDocument && ['interactive', 'complete'].includes(optionalWindowDocument.readyState)) {\n client.emit('idleSpanEnableAutoFinish', idleSpan);\n // Once the finish signal has been emitted, the listener is no longer needed. Removing it here (rather than\n // relying on `{ once: true }`) also covers the common case where the document is already loaded when the span\n // starts, so the listener never fires and would otherwise leak together with the `idleSpan` it closes over.\n optionalWindowDocument.removeEventListener('readystatechange', emitFinish);\n }\n }\n\n // Enable auto finish of the pageload span if users are not explicitly ending it\n if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {\n optionalWindowDocument.addEventListener('readystatechange', emitFinish);\n\n emitFinish();\n }\n }\n\n return {\n name: BROWSER_TRACING_INTEGRATION_ID,\n setup(client) {\n if (_isBot) {\n DEBUG_BUILD && debug.log('[Tracing] Skipping browserTracingIntegration setup for bot user agent.');\n return;\n }\n\n registerSpanErrorInstrumentation();\n\n if (\n enableLongAnimationFrame &&\n GLOBAL_OBJ.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes?.includes('long-animation-frame')\n ) {\n startTrackingLongAnimationFrames();\n } else if (enableLongTask) {\n startTrackingLongTasks();\n }\n\n if (detectRedirects && optionalWindowDocument) {\n const interactionHandler = (): void => {\n lastInteractionTimestamp = timestampInSeconds();\n };\n addEventListener('click', interactionHandler, { capture: true });\n addEventListener('keydown', interactionHandler, { capture: true, passive: true });\n }\n\n function maybeEndActiveSpan(): void {\n const activeSpan = getActiveIdleSpan(client);\n\n if (activeSpan && !spanToJSON(activeSpan).end_timestamp) {\n DEBUG_BUILD &&\n debug.log(\n `[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).attributes[SENTRY_OP]}`,\n );\n // If there's an open active span, we need to finish it before creating an new one.\n activeSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');\n activeSpan.end();\n }\n }\n\n client.on('beforeIdleSpanEnd', span => {\n // Interaction idle spans also flow through this hook, but the route bookkeeping below only\n // applies to the pageload/navigation span. We identify it by reference rather than by op:\n // only the route span is registered as the active idle span.\n if (getActiveIdleSpan(client) !== span) {\n return;\n }\n\n addPerformanceEntries(span, {\n ignoreResourceSpans,\n spanStreamingEnabled: hasSpanStreamingEnabled(client),\n });\n setActiveIdleSpan(client, undefined);\n\n // A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.\n // Only when another navigation happens, we want to create a new trace.\n // This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.\n const scope = getCurrentScope();\n const oldPropagationContext = scope.getPropagationContext();\n\n scope.setPropagationContext({\n ...oldPropagationContext,\n traceId: span.spanContext().traceId,\n sampled: spanIsSampled(span),\n dsc: getDynamicSamplingContextFromSpan(span),\n });\n\n if (_pageloadSpan === span) {\n // clean up the stored pageload span on the integration.\n _pageloadSpan = undefined;\n }\n });\n\n client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {\n if (getClient() !== client) {\n return;\n }\n\n if (navigationOptions?.isRedirect) {\n DEBUG_BUILD &&\n debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');\n _createRouteSpan(\n client,\n {\n op: NAVIGATION_REDIRECT,\n ...startSpanOptions,\n },\n false,\n navigationOptions.url,\n );\n return;\n }\n\n // Reset the last interaction timestamp since we now start a new navigation.\n // Any subsequent navigation span starts could again be a redirect, so we\n // should reset our heuristic detectors.\n lastInteractionTimestamp = undefined;\n\n maybeEndActiveSpan();\n\n const scope = getCurrentScope();\n scope.setPropagationContext({\n traceId: generateTraceId(),\n sampleRand: Math.random(),\n propagationSpanId: hasSpansEnabled() ? undefined : generateSpanId(),\n });\n\n // We reset this to ensure we do not have lingering incorrect data here\n // places that call this hook may set this where appropriate - else, the URL at span sending time is used\n scope.setSDKProcessingMetadata({\n normalizedRequest: undefined,\n });\n\n _createRouteSpan(\n client,\n {\n op: NAVIGATION,\n ...startSpanOptions,\n // Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)\n parentSpan: null,\n },\n true,\n navigationOptions?.url,\n );\n });\n\n client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {\n if (getClient() !== client) {\n return;\n }\n maybeEndActiveSpan();\n\n const sentryTrace =\n traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');\n const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');\n\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n\n const scope = getCurrentScope();\n scope.setPropagationContext(propagationContext);\n if (!hasSpansEnabled()) {\n // for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace\n // this works by setting the propagationSpanId to a random spanId so that we have a consistent\n // span id to propagate in TwP mode (!hasSpansEnabled())\n scope.getPropagationContext().propagationSpanId = generateSpanId();\n }\n\n // We store the normalized request data on the scope, so we get the request data at time of span creation\n // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL\n scope.setSDKProcessingMetadata({\n normalizedRequest: getHttpRequestData(),\n });\n\n _createRouteSpan(client, {\n op: PAGELOAD,\n ...startSpanOptions,\n });\n });\n\n client.on('endPageloadSpan', () => {\n if (enableReportPageLoaded && _pageloadSpan) {\n _pageloadSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'reportPageLoaded');\n _pageloadSpan.end();\n }\n });\n\n // `pagehide` is the last moment a document leaving the page can still send. We cannot rely on\n // `registerBackgroundTabDetection`, which ends the span on `visibilitychange`: the client's own\n // `visibilitychange` flush is registered first and its deferring microtask runs after that\n // listener but before background tab detection's, so the buffer is still empty when it drains.\n // The segment span is buffered right after with nothing left to flush it, and the children have\n // been streamed all along, which leaves a rootless trace. Ending and flushing together here\n // keeps this self-contained instead of depending on that ordering.\n WINDOW.addEventListener?.('pagehide', () => {\n const activeSpan = getActiveIdleSpan(client);\n if (activeSpan && !spanToJSON(activeSpan).end_timestamp) {\n activeSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'documentHidden');\n activeSpan.end();\n }\n void client.flush();\n });\n },\n\n afterAllSetup(client) {\n if (_isBot) {\n return;\n }\n\n // Technically, every startSpan call already ensures that `spanStreamingIntegration` is installed,\n // but we do it here anyway for the edge case that users disabled pageload and navigation spans and\n // purely rely on manual startSpan calls.\n _INTERNAL_ensureBrowserSpanStreaming(client);\n\n // Auto-register webVitalsIntegration if the user hasn't added one. We do this in\n // afterAllSetup so that a user-provided webVitalsIntegration - which may be ordered after\n // browserTracingIntegration in the integrations array - has already been installed.\n if (client.addIntegration && !client.getIntegrationByName?.(WEB_VITALS_INTEGRATION_NAME)) {\n const ignore = webVitals?.ignore ?? [];\n client.addIntegration(\n webVitalsIntegration({\n ...webVitals,\n ignore: enableInp || ignore.includes('inp') ? ignore : [...ignore, 'inp'],\n }),\n );\n }\n\n let startingUrl: string | undefined = getLocationHref();\n\n if (linkPreviousTrace !== 'off') {\n linkTraces(client, { linkPreviousTrace, consistentTraceSampling });\n }\n\n if (WINDOW.location) {\n if (instrumentPageLoad) {\n startBrowserTracingPageLoadSpan(client, {\n // With span streaming, span names have to be low cardinality, and there is no route\n // information available here.\n name: hasSpanStreamingEnabled(client) ? PAGELOAD_SPAN_NAME_FALLBACK : WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.pageload.browser',\n },\n });\n }\n\n if (instrumentNavigation) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl !== undefined && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n startingUrl = undefined;\n const parsed = parseStringToURLObject(to);\n const activeSpan = getActiveIdleSpan(client);\n const navigationIsRedirect =\n activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);\n\n startBrowserTracingNavigationSpan(\n client,\n {\n // With span streaming, span names have to be low cardinality, and there is no route\n // information available here.\n name: hasSpanStreamingEnabled(client)\n ? NAVIGATION_SPAN_NAME_FALLBACK\n : parsed?.pathname || WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.navigation.browser',\n },\n },\n { url: to, isRedirect: navigationIsRedirect },\n );\n });\n }\n\n // A bfcache restore resurrects the frozen document, so there is no document load and no\n // usable history event: `popstate` either doesn't fire or is swallowed because the URL is\n // unchanged from when the page was frozen. Without a span of its own, everything after the\n // restore joins the trace the page had before it was frozen, separated by however long it\n // sat in the cache.\n if (instrumentBfcacheRestore) {\n WINDOW.addEventListener?.('pageshow', (event: PageTransitionEvent) => {\n if (!event.persisted) {\n return;\n }\n\n // A navigation has happened, so the pageload guard in the history handler above must not\n // suppress the next one.\n startingUrl = undefined;\n\n startBrowserTracingNavigationSpan(\n client,\n {\n // Deliberately no `startTime`: the span starts now, at the restore. The\n // `PerformanceNavigationTiming` entry still describes the original document load and\n // would date the span to before the page was frozen.\n //\n // TODO(routing): resolve the parameterized route via the route provider (#23551) and set\n // the source from it. No router event fires on a restore, so in a framework app this is\n // the only navigation span still named from a raw pathname.\n name: hasSpanStreamingEnabled(client)\n ? NAVIGATION_SPAN_NAME_FALLBACK\n : WINDOW.location?.pathname || '/',\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.navigation.browser.bfcache',\n // A bfcache restore is near-instant, so these spans would otherwise drag\n // navigation duration percentiles down with no way to tell them apart.\n [BROWSER_NAVIGATION_TYPE]: 'bfcache',\n },\n },\n { url: WINDOW.location?.href },\n );\n });\n }\n }\n\n if (markBackgroundSpan) {\n registerBackgroundTabDetection();\n }\n\n instrumentOutgoingRequests(client, {\n traceFetch,\n traceXHR,\n tracePropagationTargets: client.getOptions().tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n onRequestSpanStart,\n onRequestSpanEnd,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Manually start a page load span.\n * This will only do something if a browser tracing integration integration has been setup.\n *\n * If you provide a custom `traceOptions` object, it will be used to continue the trace\n * instead of the default behavior, which is to look it up on the <meta> tags.\n */\nexport function startBrowserTracingPageLoadSpan(\n client: Client,\n spanOptions: StartSpanOptions,\n traceOptions?: { sentryTrace?: string | undefined; baggage?: string | undefined },\n): Span | undefined {\n // `Pageload` is a low-cardinality span name, not a description of the page. The scope's\n // transaction name is what error events are grouped by, so it keeps the URL instead.\n const isFallbackSpanName = spanOptions.name === PAGELOAD_SPAN_NAME_FALLBACK;\n getCurrentScope().setTransactionName(isFallbackSpanName ? WINDOW.location?.pathname : spanOptions.name);\n // A pageload span always covers the entire page load, no matter how late the SDK or a routing\n // instrumentation gets around to starting it. Everything that happened before (DNS, TLS, TTFB,\n // HTML parsing, chunk loading) is part of the page load and the performance child spans we attach\n // later are anchored at the time origin anyway.\n const timeOrigin = browserPerformanceTimeOrigin();\n const pageloadSpanOptions: StartSpanOptions = {\n ...spanOptions,\n // startTime needs to be in seconds, not ms\n startTime: spanOptions.startTime ?? (timeOrigin ? timeOrigin / 1000 : undefined),\n };\n\n client.emit('startPageLoadSpan', pageloadSpanOptions, traceOptions);\n\n const pageloadSpan = getActiveIdleSpan(client);\n\n if (pageloadSpan) {\n client.emit('afterStartPageLoadSpan', pageloadSpan);\n }\n\n return pageloadSpan;\n}\n\n/**\n * Manually start a navigation span.\n * This will only do something if a browser tracing integration has been setup.\n */\nexport function startBrowserTracingNavigationSpan(\n client: Client,\n spanOptions: StartSpanOptions,\n options?: { url?: string; isRedirect?: boolean },\n): Span | undefined {\n const { url, isRedirect } = options || {};\n client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect, url });\n client.emit('startNavigationSpan', spanOptions, { isRedirect, url });\n\n const scope = getCurrentScope();\n // `Navigation` is a low-cardinality span name, not a description of the page. The scope's\n // transaction name is what error events are grouped by, so it keeps the URL instead. `url` is the\n // destination, while `location` still points at the previous page during a `pushState`.\n const isFallbackSpanName = spanOptions.name === NAVIGATION_SPAN_NAME_FALLBACK;\n scope.setTransactionName(\n isFallbackSpanName ? (url && parseStringToURLObject(url)?.pathname) || WINDOW.location?.pathname : spanOptions.name,\n );\n\n // We store the normalized request data on the scope, so we get the request data at time of span creation\n // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL\n if (url && !isRedirect) {\n scope.setSDKProcessingMetadata({\n normalizedRequest: {\n ...getHttpRequestData(),\n url,\n },\n });\n }\n\n return getActiveIdleSpan(client);\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n /**\n * This is just a small wrapper that makes `document` optional.\n * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.\n */\n const optionalWindowDocument = WINDOW.document as (typeof WINDOW)['document'] | undefined;\n\n const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);\n return metaTag?.getAttribute('content') || undefined;\n}\n\n/** Returns the description of a server timing entry */\nexport function getServerTiming(name: string): string | undefined {\n // The cast is required for the declaration build (`build:types`), which resolves\n // `getEntriesByType('navigation')` to `PerformanceEntry[]` (no `serverTiming`). It only reads as\n // \"unnecessary\" to the type-aware linter, which runs with web-vitals' global augmentation applied.\n const navigation = WINDOW.performance?.getEntriesByType?.('navigation')[0] as PerformanceNavigationTiming | undefined;\n const entry = navigation?.serverTiming?.find(entry => entry.name === name);\n return entry?.description;\n}\n\n// We store the active idle span on the client object, so we can access it from exported functions\nconst ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';\nfunction getActiveIdleSpan(client: Client): Span | undefined {\n return (client as { [ACTIVE_IDLE_SPAN_PROPERTY]?: Span })[ACTIVE_IDLE_SPAN_PROPERTY];\n}\n\nfunction setActiveIdleSpan(client: Client, span: Span | undefined): void {\n addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);\n}\n\n// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect\nconst REDIRECT_THRESHOLD = 1.5;\n\nfunction isRedirect(activeSpan: Span, lastInteractionTimestamp: number | undefined): boolean {\n const spanData = spanToJSON(activeSpan);\n\n const now = dateTimestampInSeconds();\n\n // More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?\n // --> never consider this a redirect\n const startTimestamp = spanData.start_timestamp;\n if (now - startTimestamp > REDIRECT_THRESHOLD) {\n return false;\n }\n\n // A click happened in the last REDIRECT_THRESHOLD seconds?\n // --> never consider this a redirect\n if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {\n return false;\n }\n\n return true;\n}\n"],"names":["isRedirect","entry"],"mappings":";;;;;;;;;;;;AAuDO,MAAM,8BAAA,GAAiC;AA6N9C,MAAM,+BAAA,GAAyD;AAAA,EAC7D,GAAG,gBAAA;AAAA,EACH,oBAAA,EAAsB,IAAA;AAAA,EACtB,wBAAA,EAA0B,IAAA;AAAA,EAC1B,kBAAA,EAAoB,IAAA;AAAA,EACpB,kBAAA,EAAoB,IAAA;AAAA,EACpB,cAAA,EAAgB,IAAA;AAAA,EAChB,wBAAA,EAA0B,IAAA;AAAA;AAAA,EAE1B,SAAA,EAAW,IAAA;AAAA,EACX,qBAAqB,EAAC;AAAA,EACtB,eAAA,EAAiB,IAAA;AAAA,EACjB,iBAAA,EAAmB,WAAA;AAAA,EACnB,uBAAA,EAAyB,KAAA;AAAA,EACzB,sBAAA,EAAwB,KAAA;AAAA,EACxB,GAAG;AACL,CAAA;AAWO,MAAM,yBAAA,IAA6B,CAAC,OAAA,GAA0C,EAAC,KAAM;AAC1F,EAAA,IAAI,yBAAyB,OAAA,EAAS;AACpC,IAAA,cAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AAMA,EAAA,MAAM,yBAAyB,MAAA,CAAO,QAAA;AAEtC,EAAA,MAAM;AAAA;AAAA,IAEJ,SAAA;AAAA,IACA,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,SAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,0BAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,oBAAA;AAAA,IACA,wBAAA;AAAA,IACA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,EAAA,MAAM,aAAa,MAAA,CAAO,WAAA,EAAa,gBAAA,GAAmB,YAAY,EAAE,CAAC,CAAA;AACzE,EAAA,MAAM,KAAA,GAAQ,YAAY,YAAA,EAAc,IAAA,CAAK,CAAAC,MAAAA,KAASA,MAAAA,CAAM,SAAS,IAAI,CAAA;AACzE,EAAA,OAAO,KAAA,EAAO,WAAA;AAChB;AAGA,MAAM,yBAAA,GAA4B,kBAAA;AAClC,SAAS,kBAAkB,MAAA,EAAkC;AAC3D,EAAA,OAAQ,OAAkD,yBAAyB,CAAA;AACrF;AAEA,SAAS,iBAAA,CAAkB,QAAgB,IAAA,EAA8B;AACvE,EAAA,wBAAA,CAAyB,MAAA,EAAQ,2BAA2B,IAAI,CAAA;AAClE;AAGA,MAAM,kBAAA,GAAqB,GAAA;AAE3B,SAAS,UAAA,CAAW,YAAkB,wBAAA,EAAuD;AAC3F,EAAA,MAAM,QAAA,GAAW,WAAW,UAAU,CAAA;AAEtC,EAAA,MAAM,MAAM,sBAAA,EAAuB;AAInC,EAAA,MAAM,iBAAiB,QAAA,CAAS,eAAA;AAChC,EAAA,IAAI,GAAA,GAAM,iBAAiB,kBAAA,EAAoB;AAC7C,IAAA,OAAO,KAAA;AAAA,EACT;AAIA,EAAA,IAAI,wBAAA,IAA4B,GAAA,GAAM,wBAAA,IAA4B,kBAAA,EAAoB;AACpF,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
1
+ {"version":3,"file":"browserTracingIntegration.js","sources":["../../../../../src/tracing/browserTracingIntegration.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Client, IntegrationFn, RequestHookInfo, ResponseHookInfo, Span, StartSpanOptions } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n consoleSandbox,\n dateTimestampInSeconds,\n debug,\n generateSpanId,\n generateTraceId,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromSpan,\n GLOBAL_OBJ,\n hasSpansEnabled,\n hasSpanStreamingEnabled,\n NAVIGATION_SPAN_NAME_FALLBACK,\n PAGELOAD_SPAN_NAME_FALLBACK,\n isURLObjectRelative,\n parseStringToURLObject,\n propagationContextFromHeaders,\n registerSpanErrorInstrumentation,\n spanIsSampled,\n spanToJSON,\n timestampInSeconds,\n TRACING_DEFAULTS,\n browserPerformanceTimeOrigin,\n} from '@sentry/core';\nimport { _INTERNAL_ensureBrowserSpanStreaming, startIdleSpan, startInactiveSpan } from '@sentry/core/browser';\nimport {\n addHistoryInstrumentationHandler,\n addPerformanceEntries,\n getLocationHref,\n isBotUserAgent,\n startTrackingLongAnimationFrames,\n startTrackingLongTasks,\n} from '@sentry/browser-utils';\nimport { BROWSER_NAVIGATION_TYPE } from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { filterCollectedUrl } from '@sentry/core';\nimport { getHttpRequestData, WINDOW } from '../helpers';\nimport type { WebVitalsOptions } from '../integrations/webVitals';\nimport { WEB_VITALS_INTEGRATION_NAME, webVitalsIntegration } from '../integrations/webVitals';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport { linkTraces } from './linkedTraces';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n SENTRY_OP,\n URL_FULL,\n URL_PATH,\n SENTRY_ORIGIN,\n SENTRY_IDLE_SPAN_FINISH_REASON,\n} from '@sentry/conventions/attributes';\nimport { NAVIGATION, NAVIGATION_REDIRECT, PAGELOAD } from '@sentry/conventions/op';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * Default: 1000 (ms)\n */\n idleTimeout: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * Default: 30000 (ms)\n */\n finalTimeout: number;\n\n /**\n The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * Default: 15000 (ms)\n */\n childSpanTimeout: number;\n\n /**\n * If a span should be created on page load.\n * If this is set to `false`, this integration will not start the default page load span.\n * Default: true\n */\n instrumentPageLoad: boolean;\n\n /**\n * If a span should be created on navigation (history change).\n * If this is set to `false`, this integration will not start the default navigation spans.\n * Default: true\n */\n instrumentNavigation: boolean;\n\n /**\n * If a navigation span should be created when the page is restored from the back/forward cache.\n *\n * This is deliberately independent of {@link BrowserTracingOptions.instrumentNavigation}: a restore\n * is not a history change, and the framework integrations that own their own navigation spans turn\n * that option off without ever handling a restore. The point of this span is trace hygiene, keeping\n * everything after the restore off the trace the page had before it was frozen, so it is worth\n * having even where history instrumentation is not.\n *\n * Default: true\n */\n instrumentBfcacheRestore: boolean;\n\n /**\n * Flag spans where tabs moved to background with \"cancelled\". Browser background tab timing is\n * not suited towards doing precise measurements of operations. By default, we recommend that this option\n * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n *\n * Default: true\n */\n markBackgroundSpan: boolean;\n\n /**\n * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n *\n * Default: true\n */\n enableLongTask: boolean;\n\n /**\n * If true, Sentry will capture long animation frames and add them to the corresponding transaction.\n *\n * Default: false\n */\n enableLongAnimationFrame: boolean;\n\n /**\n * If true, Sentry will capture first input delay and add it to the corresponding transaction.\n *\n * Default: true\n *\n * @deprecated Use {@link BrowserTracingOptions.webVitals} instead: `webVitals: { ignore: ['inp'] }`.\n */\n enableInp: boolean;\n\n /**\n * Options for the `webVitalsIntegration` that is auto-registered when none is present.\n * Ignored if you register `webVitalsIntegration` yourself.\n */\n webVitals?: WebVitalsOptions;\n\n /**\n * @deprecated This option is no longer used. Element timing is now tracked via the standalone\n * `elementTimingIntegration`. Add it to your `integrations` array to collect element timing metrics.\n */\n enableElementTiming?: boolean;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * Default: true\n */\n enableHTTPTimings: boolean;\n\n /**\n * Resource spans with `op`s matching strings in the array will not be emitted.\n *\n * Default: []\n */\n ignoreResourceSpans: Array<'resource.script' | 'resource.css' | 'resource.img' | 'resource.other' | string>;\n\n /**\n * By default, the SDK will try to detect redirects and avoid creating separate spans for them.\n * If you want to opt-out of this behavior, you can set this option to `false`.\n *\n * Default: true\n */\n detectRedirects: boolean;\n\n /**\n * Link the currently started trace to a previous trace (e.g. a prior pageload, navigation or\n * manually started span). When enabled, this option will allow you to navigate between traces\n * in the Sentry UI.\n *\n * You can set this option to the following values:\n *\n * - `'in-memory'`: The previous trace data will be stored in memory.\n * This is useful for single-page applications and enabled by default.\n *\n * - `'session-storage'`: The previous trace data will be stored in the `sessionStorage`.\n * This is useful for multi-page applications or static sites but it means that the\n * Sentry SDK writes to the browser's `sessionStorage`.\n *\n * - `'off'`: The previous trace data will not be stored or linked.\n *\n * You can also use {@link BrowserTracingOptions.consistentTraceSampling} to get\n * consistent trace sampling of subsequent traces. Otherwise, by default, your\n * `tracesSampleRate` or `tracesSampler` config significantly influences how often\n * traces will be linked.\n *\n * @default 'in-memory' - see explanation above\n */\n linkPreviousTrace: 'in-memory' | 'session-storage' | 'off';\n\n /**\n * If true, Sentry will consistently sample subsequent traces based on the\n * sampling decision of the initial trace. For example, if the initial page\n * load trace was sampled positively, all subsequent traces (e.g. navigations)\n * are also sampled positively. In case the initial trace was sampled negatively,\n * all subsequent traces are also sampled negatively.\n *\n * This option allows you to get consistent, linked traces within a user journey\n * while maintaining an overall quota based on your trace sampling settings.\n *\n * This option is only effective if {@link BrowserTracingOptions.linkPreviousTrace}\n * is enabled (i.e. not set to `'off'`).\n *\n * @default `false` - this is an opt-in feature.\n */\n consistentTraceSampling: boolean;\n\n /**\n * If set to `true`, the pageload span will not end itself automatically, unless it\n * runs until the {@link BrowserTracingOptions.finalTimeout} (30 seconds by default) is reached.\n *\n * Set this option to `true`, if you want full control over the pageload span duration.\n * You can use `Sentry.reportPageLoaded()` to manually end the pageload span whenever convenient.\n * Be aware that you have to ensure that this is always called, regardless of the chosen route\n * or path in the application.\n *\n * @default `false`. By default, the pageload span will end itself automatically, based on\n * the {@link BrowserTracingOptions.finalTimeout}, {@link BrowserTracingOptions.idleTimeout}\n * and {@link BrowserTracingOptions.childSpanTimeout}. This is more convenient to use but means\n * that the pageload duration can be arbitrary and might not be fully representative of a perceived\n * page load time.\n */\n enableReportPageLoaded: boolean;\n\n /**\n * A callback which is called before a span for a pageload or navigation is started.\n * It receives the options passed to `startSpan`, and expects to return an updated options object.\n */\n beforeStartSpan?: (options: StartSpanOptions) => StartSpanOptions;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * Default: (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n\n /**\n * This callback is invoked directly after a span is started for an outgoing fetch or XHR request.\n * You can use it to annotate the span with additional data or attributes, for example by setting\n * attributes based on the passed request headers.\n */\n onRequestSpanStart?(span: Span, requestInformation: RequestHookInfo): void;\n\n /**\n * Is called when spans end for outgoing requests, providing access to response headers.\n */\n onRequestSpanEnd?(span: Span, responseInformation: ResponseHookInfo): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n ...TRACING_DEFAULTS,\n instrumentNavigation: true,\n instrumentBfcacheRestore: true,\n instrumentPageLoad: true,\n markBackgroundSpan: true,\n enableLongTask: true,\n enableLongAnimationFrame: true,\n // oxlint-disable-next-line typescript/no-deprecated -- still honoured until it is removed\n enableInp: true,\n ignoreResourceSpans: [],\n detectRedirects: true,\n linkPreviousTrace: 'in-memory',\n consistentTraceSampling: false,\n enableReportPageLoaded: false,\n ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library.\n *\n * We explicitly export the proper type here, as this has to be extended in some cases.\n */\nexport const browserTracingIntegration = ((options: Partial<BrowserTracingOptions> = {}) => {\n if ('enableElementTiming' in options) {\n consoleSandbox(() => {\n // oxlint-disable-next-line no-console\n console.warn(\n '[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.',\n );\n });\n }\n\n /**\n * This is just a small wrapper that makes `document` optional.\n * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.\n */\n const optionalWindowDocument = WINDOW.document as (typeof WINDOW)['document'] | undefined;\n\n const {\n // oxlint-disable-next-line typescript/no-deprecated -- still honoured until it is removed\n enableInp,\n enableLongTask,\n enableLongAnimationFrame,\n webVitals,\n beforeStartSpan,\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n markBackgroundSpan,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n ignoreResourceSpans,\n instrumentPageLoad,\n instrumentNavigation,\n instrumentBfcacheRestore,\n detectRedirects,\n linkPreviousTrace,\n consistentTraceSampling,\n enableReportPageLoaded,\n onRequestSpanStart,\n onRequestSpanEnd,\n } = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ...options,\n };\n\n const _isBot = isBotUserAgent();\n\n let lastInteractionTimestamp: number | undefined;\n\n let _pageloadSpan: Span | undefined;\n\n /** Create routing idle transaction. */\n function _createRouteSpan(client: Client, startSpanOptions: StartSpanOptions, makeActive = true, url?: string): void {\n const isPageloadSpan = startSpanOptions.op === 'pageload';\n\n const initialSpanName = startSpanOptions.name;\n const finalStartSpanOptions: StartSpanOptions = beforeStartSpan\n ? beforeStartSpan(startSpanOptions)\n : startSpanOptions;\n\n // For navigations, `url` is the destination URL, so we use it to reflect the post-navigation location.\n // For pageloads (and manual navigation spans without a URL) we fall back to the current location.\n const urlObject = parseStringToURLObject(url || getLocationHref());\n\n const attributes = {\n ...(urlObject?.pathname && { [URL_PATH]: urlObject.pathname }),\n ...(urlObject && !isURLObjectRelative(urlObject) && { [URL_FULL]: filterCollectedUrl(urlObject.href) }),\n ...finalStartSpanOptions.attributes,\n };\n\n // If `finalStartSpanOptions.name` is different than `startSpanOptions.name`\n // it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.\n if (initialSpanName !== finalStartSpanOptions.name) {\n attributes[SENTRY_SEGMENT_NAME_SOURCE] = 'custom';\n }\n\n finalStartSpanOptions.attributes = attributes;\n\n if (!makeActive) {\n // We want to ensure this has 0s duration\n const now = dateTimestampInSeconds();\n startInactiveSpan({\n ...finalStartSpanOptions,\n startTime: now,\n }).end(now);\n return;\n }\n\n const idleSpan = startIdleSpan(finalStartSpanOptions, {\n idleTimeout,\n finalTimeout,\n childSpanTimeout,\n // should wait for finish signal if it's a pageload transaction\n disableAutoFinish: isPageloadSpan,\n trimIdleSpanEndTimestamp: !enableReportPageLoaded,\n });\n\n if (isPageloadSpan && enableReportPageLoaded) {\n _pageloadSpan = idleSpan;\n }\n\n setActiveIdleSpan(client, idleSpan);\n\n function emitFinish(): void {\n if (optionalWindowDocument && ['interactive', 'complete'].includes(optionalWindowDocument.readyState)) {\n client.emit('idleSpanEnableAutoFinish', idleSpan);\n // Once the finish signal has been emitted, the listener is no longer needed. Removing it here (rather than\n // relying on `{ once: true }`) also covers the common case where the document is already loaded when the span\n // starts, so the listener never fires and would otherwise leak together with the `idleSpan` it closes over.\n optionalWindowDocument.removeEventListener('readystatechange', emitFinish);\n }\n }\n\n // Enable auto finish of the pageload span if users are not explicitly ending it\n if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {\n optionalWindowDocument.addEventListener('readystatechange', emitFinish);\n\n emitFinish();\n }\n }\n\n return {\n name: BROWSER_TRACING_INTEGRATION_ID,\n setup(client) {\n if (_isBot) {\n DEBUG_BUILD && debug.log('[Tracing] Skipping browserTracingIntegration setup for bot user agent.');\n return;\n }\n\n registerSpanErrorInstrumentation();\n\n if (\n enableLongAnimationFrame &&\n GLOBAL_OBJ.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes?.includes('long-animation-frame')\n ) {\n startTrackingLongAnimationFrames();\n } else if (enableLongTask) {\n startTrackingLongTasks();\n }\n\n if (detectRedirects && optionalWindowDocument) {\n const interactionHandler = (): void => {\n lastInteractionTimestamp = timestampInSeconds();\n };\n addEventListener('click', interactionHandler, { capture: true });\n addEventListener('keydown', interactionHandler, { capture: true, passive: true });\n }\n\n function maybeEndActiveSpan(): void {\n const activeSpan = getActiveIdleSpan(client);\n\n if (activeSpan && !spanToJSON(activeSpan).end_timestamp) {\n DEBUG_BUILD &&\n debug.log(\n `[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).attributes[SENTRY_OP]}`,\n );\n // If there's an open active span, we need to finish it before creating an new one.\n activeSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');\n activeSpan.end();\n }\n }\n\n client.on('beforeIdleSpanEnd', span => {\n // Interaction idle spans also flow through this hook, but the route bookkeeping below only\n // applies to the pageload/navigation span. We identify it by reference rather than by op:\n // only the route span is registered as the active idle span.\n if (getActiveIdleSpan(client) !== span) {\n return;\n }\n\n addPerformanceEntries(span, {\n ignoreResourceSpans,\n spanStreamingEnabled: hasSpanStreamingEnabled(client),\n });\n setActiveIdleSpan(client, undefined);\n\n // A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.\n // Only when another navigation happens, we want to create a new trace.\n // This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.\n const scope = getCurrentScope();\n const oldPropagationContext = scope.getPropagationContext();\n\n scope.setPropagationContext({\n ...oldPropagationContext,\n traceId: span.spanContext().traceId,\n sampled: spanIsSampled(span),\n dsc: getDynamicSamplingContextFromSpan(span),\n });\n\n if (_pageloadSpan === span) {\n // clean up the stored pageload span on the integration.\n _pageloadSpan = undefined;\n }\n });\n\n client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {\n if (getClient() !== client) {\n return;\n }\n\n if (navigationOptions?.isRedirect) {\n DEBUG_BUILD &&\n debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');\n _createRouteSpan(\n client,\n {\n op: NAVIGATION_REDIRECT,\n ...startSpanOptions,\n },\n false,\n navigationOptions.url,\n );\n return;\n }\n\n // Reset the last interaction timestamp since we now start a new navigation.\n // Any subsequent navigation span starts could again be a redirect, so we\n // should reset our heuristic detectors.\n lastInteractionTimestamp = undefined;\n\n maybeEndActiveSpan();\n\n const scope = getCurrentScope();\n scope.setPropagationContext({\n traceId: generateTraceId(),\n sampleRand: Math.random(),\n propagationSpanId: hasSpansEnabled() ? undefined : generateSpanId(),\n });\n\n // We reset this to ensure we do not have lingering incorrect data here\n // places that call this hook may set this where appropriate - else, the URL at span sending time is used\n scope.setSDKProcessingMetadata({\n normalizedRequest: undefined,\n });\n\n _createRouteSpan(\n client,\n {\n op: NAVIGATION,\n ...startSpanOptions,\n // Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)\n parentSpan: null,\n },\n true,\n navigationOptions?.url,\n );\n });\n\n client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {\n if (getClient() !== client) {\n return;\n }\n maybeEndActiveSpan();\n\n const sentryTrace =\n traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');\n const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');\n\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n\n const scope = getCurrentScope();\n scope.setPropagationContext(propagationContext);\n if (!hasSpansEnabled()) {\n // for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace\n // this works by setting the propagationSpanId to a random spanId so that we have a consistent\n // span id to propagate in TwP mode (!hasSpansEnabled())\n scope.getPropagationContext().propagationSpanId = generateSpanId();\n }\n\n // We store the normalized request data on the scope, so we get the request data at time of span creation\n // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL\n scope.setSDKProcessingMetadata({\n normalizedRequest: getHttpRequestData(),\n });\n\n _createRouteSpan(client, {\n op: PAGELOAD,\n ...startSpanOptions,\n });\n });\n\n client.on('endPageloadSpan', () => {\n if (enableReportPageLoaded && _pageloadSpan) {\n _pageloadSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'reportPageLoaded');\n _pageloadSpan.end();\n }\n });\n\n // `pagehide` is the last moment a document leaving the page can still send. We cannot rely on\n // `registerBackgroundTabDetection`, which ends the span on `visibilitychange`: the client's own\n // `visibilitychange` flush is registered first and its deferring microtask runs after that\n // listener but before background tab detection's, so the buffer is still empty when it drains.\n // The segment span is buffered right after with nothing left to flush it, and the children have\n // been streamed all along, which leaves a rootless trace. Ending and flushing together here\n // keeps this self-contained instead of depending on that ordering.\n WINDOW.addEventListener?.('pagehide', () => {\n const activeSpan = getActiveIdleSpan(client);\n if (activeSpan && !spanToJSON(activeSpan).end_timestamp) {\n activeSpan.setAttribute(SENTRY_IDLE_SPAN_FINISH_REASON, 'documentHidden');\n activeSpan.end();\n }\n void client.flush();\n });\n },\n\n afterAllSetup(client) {\n if (_isBot) {\n return;\n }\n\n // Technically, every startSpan call already ensures that `spanStreamingIntegration` is installed,\n // but we do it here anyway for the edge case that users disabled pageload and navigation spans and\n // purely rely on manual startSpan calls.\n _INTERNAL_ensureBrowserSpanStreaming(client);\n\n // Auto-register webVitalsIntegration if the user hasn't added one. We do this in\n // afterAllSetup so that a user-provided webVitalsIntegration - which may be ordered after\n // browserTracingIntegration in the integrations array - has already been installed.\n if (client.addIntegration && !client.getIntegrationByName?.(WEB_VITALS_INTEGRATION_NAME)) {\n const ignore = webVitals?.ignore ?? [];\n client.addIntegration(\n webVitalsIntegration({\n ...webVitals,\n ignore: enableInp || ignore.includes('inp') ? ignore : [...ignore, 'inp'],\n }),\n );\n }\n\n let startingUrl: string | undefined = getLocationHref();\n\n if (linkPreviousTrace !== 'off') {\n linkTraces(client, { linkPreviousTrace, consistentTraceSampling });\n }\n\n if (WINDOW.location) {\n if (instrumentPageLoad) {\n startBrowserTracingPageLoadSpan(client, {\n // With span streaming, span names have to be low cardinality, and there is no route\n // information available here.\n name: hasSpanStreamingEnabled(client) ? PAGELOAD_SPAN_NAME_FALLBACK : WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.pageload.browser',\n },\n });\n }\n\n if (instrumentNavigation) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl !== undefined && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n startingUrl = undefined;\n const parsed = parseStringToURLObject(to);\n const activeSpan = getActiveIdleSpan(client);\n const navigationIsRedirect =\n activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);\n\n startBrowserTracingNavigationSpan(\n client,\n {\n // With span streaming, span names have to be low cardinality, and there is no route\n // information available here.\n name: hasSpanStreamingEnabled(client)\n ? NAVIGATION_SPAN_NAME_FALLBACK\n : parsed?.pathname || WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.navigation.browser',\n },\n },\n { url: to, isRedirect: navigationIsRedirect },\n );\n });\n }\n\n // A bfcache restore resurrects the frozen document, so there is no document load and no\n // usable history event: `popstate` either doesn't fire or is swallowed because the URL is\n // unchanged from when the page was frozen. Without a span of its own, everything after the\n // restore joins the trace the page had before it was frozen, separated by however long it\n // sat in the cache.\n if (instrumentBfcacheRestore) {\n WINDOW.addEventListener?.('pageshow', (event: PageTransitionEvent) => {\n if (!event.persisted) {\n return;\n }\n\n // A navigation has happened, so the pageload guard in the history handler above must not\n // suppress the next one.\n startingUrl = undefined;\n\n startBrowserTracingNavigationSpan(\n client,\n {\n // Deliberately no `startTime`: the span starts now, at the restore. The\n // `PerformanceNavigationTiming` entry still describes the original document load and\n // would date the span to before the page was frozen.\n //\n // TODO(routing): resolve the parameterized route via the route provider (#23551) and set\n // the source from it. No router event fires on a restore, so in a framework app this is\n // the only navigation span still named from a raw pathname.\n name: hasSpanStreamingEnabled(client)\n ? NAVIGATION_SPAN_NAME_FALLBACK\n : WINDOW.location?.pathname || '/',\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'url',\n [SENTRY_ORIGIN]: 'auto.navigation.browser.bfcache',\n // A bfcache restore is near-instant, so these spans would otherwise drag\n // navigation duration percentiles down with no way to tell them apart.\n [BROWSER_NAVIGATION_TYPE]: 'back-forward-cache',\n },\n },\n { url: WINDOW.location?.href },\n );\n });\n }\n }\n\n if (markBackgroundSpan) {\n registerBackgroundTabDetection();\n }\n\n instrumentOutgoingRequests(client, {\n traceFetch,\n traceXHR,\n tracePropagationTargets: client.getOptions().tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n onRequestSpanStart,\n onRequestSpanEnd,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Manually start a page load span.\n * This will only do something if a browser tracing integration integration has been setup.\n *\n * If you provide a custom `traceOptions` object, it will be used to continue the trace\n * instead of the default behavior, which is to look it up on the <meta> tags.\n */\nexport function startBrowserTracingPageLoadSpan(\n client: Client,\n spanOptions: StartSpanOptions,\n traceOptions?: { sentryTrace?: string | undefined; baggage?: string | undefined },\n): Span | undefined {\n // `Pageload` is a low-cardinality span name, not a description of the page. The scope's\n // transaction name is what error events are grouped by, so it keeps the URL instead.\n const isFallbackSpanName = spanOptions.name === PAGELOAD_SPAN_NAME_FALLBACK;\n getCurrentScope().setTransactionName(isFallbackSpanName ? WINDOW.location?.pathname : spanOptions.name);\n // A pageload span always covers the entire page load, no matter how late the SDK or a routing\n // instrumentation gets around to starting it. Everything that happened before (DNS, TLS, TTFB,\n // HTML parsing, chunk loading) is part of the page load and the performance child spans we attach\n // later are anchored at the time origin anyway.\n const timeOrigin = browserPerformanceTimeOrigin();\n const pageloadSpanOptions: StartSpanOptions = {\n ...spanOptions,\n // startTime needs to be in seconds, not ms\n startTime: spanOptions.startTime ?? (timeOrigin ? timeOrigin / 1000 : undefined),\n };\n\n client.emit('startPageLoadSpan', pageloadSpanOptions, traceOptions);\n\n const pageloadSpan = getActiveIdleSpan(client);\n\n if (pageloadSpan) {\n client.emit('afterStartPageLoadSpan', pageloadSpan);\n }\n\n return pageloadSpan;\n}\n\n/**\n * Manually start a navigation span.\n * This will only do something if a browser tracing integration has been setup.\n */\nexport function startBrowserTracingNavigationSpan(\n client: Client,\n spanOptions: StartSpanOptions,\n options?: { url?: string; isRedirect?: boolean },\n): Span | undefined {\n const { url, isRedirect } = options || {};\n client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect, url });\n client.emit('startNavigationSpan', spanOptions, { isRedirect, url });\n\n const scope = getCurrentScope();\n // `Navigation` is a low-cardinality span name, not a description of the page. The scope's\n // transaction name is what error events are grouped by, so it keeps the URL instead. `url` is the\n // destination, while `location` still points at the previous page during a `pushState`.\n const isFallbackSpanName = spanOptions.name === NAVIGATION_SPAN_NAME_FALLBACK;\n scope.setTransactionName(\n isFallbackSpanName ? (url && parseStringToURLObject(url)?.pathname) || WINDOW.location?.pathname : spanOptions.name,\n );\n\n // We store the normalized request data on the scope, so we get the request data at time of span creation\n // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL\n if (url && !isRedirect) {\n scope.setSDKProcessingMetadata({\n normalizedRequest: {\n ...getHttpRequestData(),\n url,\n },\n });\n }\n\n return getActiveIdleSpan(client);\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n /**\n * This is just a small wrapper that makes `document` optional.\n * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.\n */\n const optionalWindowDocument = WINDOW.document as (typeof WINDOW)['document'] | undefined;\n\n const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);\n return metaTag?.getAttribute('content') || undefined;\n}\n\n/** Returns the description of a server timing entry */\nexport function getServerTiming(name: string): string | undefined {\n // The cast is required for the declaration build (`build:types`), which resolves\n // `getEntriesByType('navigation')` to `PerformanceEntry[]` (no `serverTiming`). It only reads as\n // \"unnecessary\" to the type-aware linter, which runs with web-vitals' global augmentation applied.\n const navigation = WINDOW.performance?.getEntriesByType?.('navigation')[0] as PerformanceNavigationTiming | undefined;\n const entry = navigation?.serverTiming?.find(entry => entry.name === name);\n return entry?.description;\n}\n\n// We store the active idle span on the client object, so we can access it from exported functions\nconst ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';\nfunction getActiveIdleSpan(client: Client): Span | undefined {\n return (client as { [ACTIVE_IDLE_SPAN_PROPERTY]?: Span })[ACTIVE_IDLE_SPAN_PROPERTY];\n}\n\nfunction setActiveIdleSpan(client: Client, span: Span | undefined): void {\n addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);\n}\n\n// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect\nconst REDIRECT_THRESHOLD = 1.5;\n\nfunction isRedirect(activeSpan: Span, lastInteractionTimestamp: number | undefined): boolean {\n const spanData = spanToJSON(activeSpan);\n\n const now = dateTimestampInSeconds();\n\n // More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?\n // --> never consider this a redirect\n const startTimestamp = spanData.start_timestamp;\n if (now - startTimestamp > REDIRECT_THRESHOLD) {\n return false;\n }\n\n // A click happened in the last REDIRECT_THRESHOLD seconds?\n // --> never consider this a redirect\n if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {\n return false;\n }\n\n return true;\n}\n"],"names":["isRedirect","entry"],"mappings":";;;;;;;;;;;;AAuDO,MAAM,8BAAA,GAAiC;AA6N9C,MAAM,+BAAA,GAAyD;AA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,EAAA,OAAO,KAAA,EAAO,WAAA;AAChB;AAGA,MAAM,yBAAA,GAA4B,kBAAA;AAClC,SAAS,kBAAkB,MAAA,EAAkC;AAC3D,EAAA,OAAQ,OAAkD,yBAAyB,CAAA;AACrF;AAEA,SAAS,iBAAA,CAAkB,QAAgB,IAAA,EAA8B;AACvE,EAAA,wBAAA,CAAyB,MAAA,EAAQ,2BAA2B,IAAI,CAAA;AAClE;AAGA,MAAM,kBAAA,GAAqB,GAAA;AAE3B,SAAS,UAAA,CAAW,YAAkB,wBAAA,EAAuD;AAC3F,EAAA,MAAM,QAAA,GAAW,WAAW,UAAU,CAAA;AAEtC,EAAA,MAAM,MAAM,sBAAA,EAAuB;AAInC,EAAA,MAAM,iBAAiB,QAAA,CAAS,eAAA;AAChC,EAAA,IAAI,GAAA,GAAM,iBAAiB,kBAAA,EAAoB;AAC7C,IAAA,OAAO,KAAA;AAAA,EACT;AAIA,EAAA,IAAI,wBAAA,IAA4B,GAAA,GAAM,wBAAA,IAA4B,kBAAA,EAAoB;AACpF,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
@@ -1,7 +1,7 @@
1
1
  export type { Breadcrumb, BreadcrumbHint, Context, Contexts, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, ReportDialogOptions, CaptureContext, ExclusiveEventHintOrCaptureContext, Log, LogSeverityLevel, } from '@sentry/core';
2
2
  export type { BrowserOptions } from './client';
3
3
  export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getIsolationScope, getGlobalScope, setCurrentClient, Scope, continueTrace, getTraceData, suppressTracing, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, setConversationId, withScope, withIsolationScope, functionToStringIntegration, eventFiltersIntegration, dedupeIntegration, consoleIntegration, parameterize, startSession, captureSession, endSession, spanToStaticSpanJSON, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, withStaticSpan, withStreamedSpan, } from '@sentry/core';
4
- export { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SENTRY_SEGMENT_NAME_SOURCE, } from '@sentry/core';
4
+ export { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, } from '@sentry/core';
5
5
  export { WINDOW } from './helpers';
6
6
  export { BrowserClient } from './client';
7
7
  export { makeFetchTransport } from './transports/fetch';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,kCAAkC,EAClC,GAAG,EACH,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OA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EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,kCAAkC,EAClC,GAAG,EACH,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,YAAY,EACZ,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EAEd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,qCAAqC,GACtC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,10 +1,18 @@
1
- import type { Mechanism, WrappedFunction } from '@sentry/core';
1
+ import type { HandlerDataError, Mechanism, WrappedFunction } from '@sentry/core';
2
2
  import { GLOBAL_OBJ } from '@sentry/core';
3
3
  export declare const WINDOW: typeof GLOBAL_OBJ & Window;
4
+ type ErrorReport = Pick<HandlerDataError, 'msg' | 'url' | 'line' | 'column'>;
4
5
  /**
5
6
  * @hidden
6
7
  */
7
- export declare function shouldIgnoreOnError(): boolean;
8
+ export declare function shouldIgnoreOnError(data?: HandlerDataError): boolean;
9
+ /**
10
+ * Skips the next `onerror` report that matches `report`, once. A report that
11
+ * never arrives is forgotten after the current task.
12
+ *
13
+ * @hidden
14
+ */
15
+ export declare function ignoreNextOnErrorMatching(report: ErrorReport): void;
8
16
  /**
9
17
  * @hidden
10
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAML,UAAU,EAGX,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,MAAM,EAAiB,OAAO,UAAU,GAAG,MAAM,CAAC;AAI/D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAGD,KAAK,iBAAiB,GAAG,QAAQ,CAAC;AAElC,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAC9C,EAAE,EAAE,CAAC,EACL,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,eAAe,CAAC,CAAC,CAAC,CAAC;AACtB,wBAAgB,IAAI,CAAC,WAAW,EAC9B,EAAE,EAAE,WAAW,EACf,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,WAAW,CAAC;AA0If;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAgBrF"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAML,UAAU,EAGX,MAAM,cAAc,CAAC;AAGtB,eAAO,MAAM,MAAM,EAAiB,OAAO,UAAU,GAAG,MAAM,CAAC;AAI/D,KAAK,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAI7E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAYpE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAQnE;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAGD,KAAK,iBAAiB,GAAG,QAAQ,CAAC;AAElC,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAC9C,EAAE,EAAE,CAAC,EACL,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,eAAe,CAAC,CAAC,CAAC,CAAC;AACtB,wBAAgB,IAAI,CAAC,WAAW,EAC9B,EAAE,EAAE,WAAW,EACf,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,WAAW,CAAC;AA0If;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAgBrF"}
@@ -15,5 +15,9 @@ export declare function _getUnhandledRejectionError(error: unknown): unknown;
15
15
  * @returns An Event object with an appropriate `exception` value
16
16
  */
17
17
  export declare function _eventFromRejectionWithPrimitive(reason: Primitive): Event;
18
+ /**
19
+ * Adds a frame built from the error location when the event has none.
20
+ */
21
+ export declare function _enhanceEventWithInitialFrame(event: Event, url: string | undefined, lineno: number | undefined, colno: number | undefined): Event;
18
22
  export {};
19
23
  //# sourceMappingURL=globalhandlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"globalhandlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/globalhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,KAAK,EAAiB,SAAS,EAAe,MAAM,cAAc,CAAC;AAmBzF,KAAK,oCAAoC,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE/E,KAAK,0BAA0B,GAAG,MAAM,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;AA6BxF,eAAO,MAAM,yBAAyB;;CAAgD,CAAC;AAyDvF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA0BnE;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAYzE"}
1
+ {"version":3,"file":"globalhandlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/globalhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,KAAK,EAAiB,SAAS,EAAe,MAAM,cAAc,CAAC;AAmBzF,KAAK,oCAAoC,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE/E,KAAK,0BAA0B,GAAG,MAAM,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;AA6BxF,eAAO,MAAM,yBAAyB;;CAAgD,CAAC;AAyDvF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA0BnE;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAYzE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,KAAK,CAuBP"}
@@ -1 +1 @@
1
- {"version":3,"file":"httpcontext.d.ts","sourceRoot":"","sources":["../../../../src/integrations/httpcontext.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CA4DjC,CAAC"}
1
+ {"version":3,"file":"httpcontext.d.ts","sourceRoot":"","sources":["../../../../src/integrations/httpcontext.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CAwEjC,CAAC"}
@@ -6,10 +6,17 @@ export type SpotlightConnectionOptions = {
6
6
  sidecarUrl?: string;
7
7
  };
8
8
  export declare const INTEGRATION_NAME: 'SpotlightBrowser';
9
- export declare const SPOTLIGHT_IGNORE_SPANS: {
9
+ export declare const SPOTLIGHT_IGNORE_SPANS: ({
10
10
  op: string;
11
11
  name: string;
12
- }[];
12
+ attributes?: undefined;
13
+ } | {
14
+ name?: undefined;
15
+ op: string;
16
+ attributes: {
17
+ 'browser.web_vital.inp.target': string;
18
+ };
19
+ })[];
13
20
  /**
14
21
  * Use this integration to send errors and transactions to Spotlight.
15
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../../src/integrations/spotlight.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;GAA4D,CAAC;AAuDhG;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;CAA2C,CAAC"}
1
+ {"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../../src/integrations/spotlight.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;;;;;;QAES,8BAA8B;;IACzE,CAAC;AAuDF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;CAA2C,CAAC"}
@@ -30,7 +30,7 @@ export interface WebVitalsOptions {
30
30
  *
31
31
  * A restore is a new page view measured against a document that was never reloaded, so its vitals
32
32
  * are reported against the navigation span `browserTracingIntegration` starts for the restore,
33
- * and tagged `browser.navigation.type: bfcache`. A restore is near-instant by construction, so
33
+ * and tagged `browser.navigation.type: back-forward-cache`. A restore is near-instant by construction, so
34
34
  * these are a distinct population from page load vitals and are meant to be read through that
35
35
  * attribute rather than pooled with them. Set this to `false` to leave restores unmeasured.
36
36
  *
@@ -105,11 +105,12 @@ interface RegisterWebWorkerOptions {
105
105
  * This function will:
106
106
  * - Send debug IDs to the parent thread
107
107
  * - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)
108
- * - Set up a handler for unhandled rejections in the worker
109
- * - Forward unhandled rejections to the parent thread for capture
108
+ * - Set up handlers for uncaught errors and unhandled rejections in the worker
109
+ * - Forward both to the parent thread for capture
110
110
  *
111
- * Note: Synchronous errors in workers are already captured by globalHandlers.
112
- * This only handles unhandled promise rejections which don't bubble to the parent.
111
+ * Note: uncaught errors do bubble to the parent, but the propagated `ErrorEvent` carries
112
+ * no `error` object, so globalHandlers can only build an event from the message string.
113
+ * Forwarding them here preserves the real stack, which matters most for wasm frames.
113
114
  *
114
115
  * @example
115
116
  * ```ts filename={worker.js}
@@ -1 +1 @@
1
- {"version":3,"file":"webWorker.d.ts","sourceRoot":"","sources":["../../../../src/integrations/webWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO3E,eAAO,MAAM,gBAAgB,EAAG,WAAoB,CAAC;AAmBrD,UAAU,oBAAqB,SAAQ,WAAW;IAChD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,K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B,EAM1B,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAoI3C;;;;;;;;GAQG;AACH,UAAU,iCAAiC;IACzC,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED,UAAU,wBAAwB;IAChC,IAAI,EAAE,iCAAiC,GAAG;QACxC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7C,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,GAAG,IAAI,CA6C1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/browser",
3
- "version": "11.0.0-rc.0",
3
+ "version": "11.0.0",
4
4
  "description": "Official Sentry SDK for browsers",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -38,15 +38,15 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@sentry/browser-utils": "11.0.0-rc.0",
41
+ "@sentry/browser-utils": "11.0.0",
42
42
  "@sentry/conventions": "^0.23.0",
43
- "@sentry/feedback": "11.0.0-rc.0",
44
- "@sentry/replay": "11.0.0-rc.0",
45
- "@sentry/replay-canvas": "11.0.0-rc.0",
46
- "@sentry/core": "11.0.0-rc.0"
43
+ "@sentry/feedback": "11.0.0",
44
+ "@sentry/replay": "11.0.0",
45
+ "@sentry/replay-canvas": "11.0.0",
46
+ "@sentry/core": "11.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@sentry-internal/integration-shims": "11.0.0-rc.0",
49
+ "@sentry-internal/integration-shims": "11.0.0",
50
50
  "fake-indexeddb": "^6.2.5"
51
51
  },
52
52
  "scripts": {