@sentry/browser 10.53.1 → 10.54.0

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