@sentry/browser 10.53.0 → 10.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1 +1 @@
1
- {"version":3,"file":"setActiveSpan.js","sources":["../../../../../src/tracing/setActiveSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { _INTERNAL_setSpanForScope, getActiveSpan, getCurrentScope } from '@sentry/core/browser';\n\n/**\n * Sets an inactive span active on the current scope.\n *\n * This is useful in browser applications, if you want to create a span that cannot be finished\n * within its callback. Any spans started while the given span is active, will be children of the span.\n *\n * If there already was an active span on the scope prior to calling this function, it is replaced\n * with the given span and restored after the span ended. Otherwise, the span will simply be\n * removed, resulting in no active span on the scope.\n *\n * IMPORTANT: This function can ONLY be used in the browser! Calling this function in a server\n * environment (for example in a server-side rendered component) will result in undefined behaviour\n * and is not supported.\n * You MUST call `span.end()` manually, otherwise the span will never be finished.\n *\n * @example\n * ```js\n * let checkoutSpan;\n *\n * on('checkoutStarted', () => {\n * checkoutSpan = Sentry.startInactiveSpan({ name: 'checkout-flow' });\n * Sentry.setActiveSpanInBrowser(checkoutSpan);\n * })\n *\n * // during this time, any spans started will be children of `checkoutSpan`:\n * Sentry.startSpan({ name: 'checkout-step-1' }, () => {\n * // ... `\n * })\n *\n * on('checkoutCompleted', () => {\n * checkoutSpan?.end();\n * })\n * ```\n *\n * @param span - the span to set active\n */\nexport function setActiveSpanInBrowser(span: Span): void {\n const maybePreviousActiveSpan = getActiveSpan();\n\n // If the span is already active, there's no need to double-patch or set it again.\n // This also guards against users (for whatever reason) calling setActiveSpanInBrowser on SDK-started\n // idle spans like pageload or navigation spans. These will already be handled correctly by the SDK.\n // For nested situations, we have to double-patch to ensure we restore the correct previous span (see tests)\n if (maybePreviousActiveSpan === span) {\n return;\n }\n\n const scope = getCurrentScope();\n\n // Putting a small patch onto the span.end method to ensure we\n // remove the span from the scope when it ends.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args: Parameters<Span['end']>) {\n _INTERNAL_setSpanForScope(scope, maybePreviousActiveSpan);\n return Reflect.apply(target, thisArg, args);\n },\n });\n\n _INTERNAL_setSpanForScope(scope, span);\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,IAAI,EAAc;AACzD,EAAE,MAAM,uBAAA,GAA0B,aAAa,EAAE;;AAEjD;AACA;AACA;AACA;AACA,EAAE,IAAI,uBAAA,KAA4B,IAAI,EAAE;AACxC,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,KAAA,GAAQ,eAAe,EAAE;;AAEjC;AACA;AACA;AACA,EAAE,IAAI,CAAC,GAAA,GAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;AACjC,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAA2B;AAC1D,MAAM,yBAAyB,CAAC,KAAK,EAAE,uBAAuB,CAAC;AAC/D,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AACjD,IAAI,CAAC;AACL,GAAG,CAAC;;AAEJ,EAAE,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC;AACxC;;;;"}
1
+ {"version":3,"file":"setActiveSpan.js","sources":["../../../../../src/tracing/setActiveSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { _INTERNAL_setSpanForScope, getActiveSpan, getCurrentScope } from '@sentry/core/browser';\n\n/**\n * Sets an inactive span active on the current scope.\n *\n * This is useful in browser applications, if you want to create a span that cannot be finished\n * within its callback. Any spans started while the given span is active, will be children of the span.\n *\n * If there already was an active span on the scope prior to calling this function, it is replaced\n * with the given span and restored after the span ended. Otherwise, the span will simply be\n * removed, resulting in no active span on the scope.\n *\n * IMPORTANT: This function can ONLY be used in the browser! Calling this function in a server\n * environment (for example in a server-side rendered component) will result in undefined behaviour\n * and is not supported.\n * You MUST call `span.end()` manually, otherwise the span will never be finished.\n *\n * @example\n * ```js\n * let checkoutSpan;\n *\n * on('checkoutStarted', () => {\n * checkoutSpan = Sentry.startInactiveSpan({ name: 'checkout-flow' });\n * Sentry.setActiveSpanInBrowser(checkoutSpan);\n * })\n *\n * // during this time, any spans started will be children of `checkoutSpan`:\n * Sentry.startSpan({ name: 'checkout-step-1' }, () => {\n * // ... `\n * })\n *\n * on('checkoutCompleted', () => {\n * checkoutSpan?.end();\n * })\n * ```\n *\n * @param span - the span to set active\n */\nexport function setActiveSpanInBrowser(span: Span): void {\n const maybePreviousActiveSpan = getActiveSpan();\n\n // If the span is already active, there's no need to double-patch or set it again.\n // This also guards against users (for whatever reason) calling setActiveSpanInBrowser on SDK-started\n // idle spans like pageload or navigation spans. These will already be handled correctly by the SDK.\n // For nested situations, we have to double-patch to ensure we restore the correct previous span (see tests)\n if (maybePreviousActiveSpan === span) {\n return;\n }\n\n const scope = getCurrentScope();\n\n // Putting a small patch onto the span.end method to ensure we\n // remove the span from the scope when it ends.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args: Parameters<Span['end']>) {\n _INTERNAL_setSpanForScope(scope, maybePreviousActiveSpan);\n return Reflect.apply(target, thisArg, args);\n },\n });\n\n _INTERNAL_setSpanForScope(scope, span);\n}\n"],"names":[],"mappings":";;AAuCO,SAAS,uBAAuB,IAAA,EAAkB;AACvD,EAAA,MAAM,0BAA0B,aAAA,EAAc;AAM9C,EAAA,IAAI,4BAA4B,IAAA,EAAM;AACpC,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAK9B,EAAA,IAAA,CAAK,GAAA,GAAM,IAAI,KAAA,CAAM,IAAA,CAAK,GAAA,EAAK;AAAA,IAC7B,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,IAAA,EAA+B;AACpD,MAAA,yBAAA,CAA0B,OAAO,uBAAuB,CAAA;AACxD,MAAA,OAAO,OAAA,CAAQ,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,IAAI,CAAA;AAAA,IAC5C;AAAA,GACD,CAAA;AAED,EAAA,yBAAA,CAA0B,OAAO,IAAI,CAAA;AACvC;;;;"}
@@ -1,47 +1,24 @@
1
1
  import { WINDOW } from '../helpers.js';
2
2
 
3
- /**
4
- * Checks if the baggage header has Sentry values.
5
- */
6
3
  function baggageHeaderHasSentryValues(baggageHeader) {
7
- return baggageHeader.split(',').some(value => value.trim().startsWith('sentry-'));
4
+ return baggageHeader.split(",").some((value) => value.trim().startsWith("sentry-"));
8
5
  }
9
-
10
- /**
11
- * Gets the full URL from a given URL string.
12
- */
13
6
  function getFullURL(url) {
14
7
  try {
15
- // By adding a base URL to new URL(), this will also work for relative urls
16
- // If `url` is a full URL, the base URL is ignored anyhow
17
8
  const parsed = new URL(url, WINDOW.location.origin);
18
9
  return parsed.href;
19
10
  } catch {
20
- return undefined;
11
+ return void 0;
21
12
  }
22
13
  }
23
-
24
- /**
25
- * Checks if the entry is a PerformanceResourceTiming.
26
- */
27
14
  function isPerformanceResourceTiming(entry) {
28
- return (
29
- entry.entryType === 'resource' &&
30
- 'initiatorType' in entry &&
31
- typeof (entry ).nextHopProtocol === 'string' &&
32
- (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')
33
- );
15
+ return entry.entryType === "resource" && "initiatorType" in entry && typeof entry.nextHopProtocol === "string" && (entry.initiatorType === "fetch" || entry.initiatorType === "xmlhttprequest");
34
16
  }
35
-
36
- /**
37
- * Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails.
38
- */
39
17
  function createHeadersSafely(headers) {
40
18
  try {
41
19
  return new Headers(headers);
42
20
  } catch {
43
- // noop
44
- return undefined;
21
+ return void 0;
45
22
  }
46
23
  }
47
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/tracing/utils.ts"],"sourcesContent":["import { WINDOW } from '../helpers';\n\n/**\n * Checks if the baggage header has Sentry values.\n */\nexport function baggageHeaderHasSentryValues(baggageHeader: string): boolean {\n return baggageHeader.split(',').some(value => value.trim().startsWith('sentry-'));\n}\n\n/**\n * Gets the full URL from a given URL string.\n */\nexport function getFullURL(url: string): string | undefined {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Checks if the entry is a PerformanceResourceTiming.\n */\nexport function isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails.\n */\nexport function createHeadersSafely(headers: Record<string, string> | undefined): Headers | undefined {\n try {\n return new Headers(headers);\n } catch {\n // noop\n return undefined;\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACO,SAAS,4BAA4B,CAAC,aAAa,EAAmB;AAC7E,EAAE,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAA,IAAS,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACnF;;AAEA;AACA;AACA;AACO,SAAS,UAAU,CAAC,GAAG,EAA8B;AAC5D,EAAE,IAAI;AACN;AACA;AACA,IAAI,MAAM,MAAA,GAAS,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AACvD,IAAI,OAAO,MAAM,CAAC,IAAI;AACtB,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B,CAAC,KAAK,EAAwD;AACzG,EAAE;AACF,IAAI,KAAK,CAAC,SAAA,KAAc,UAAA;AACxB,IAAI,eAAA,IAAmB,KAAA;AACvB,IAAI,OAAO,CAAC,KAAA,GAAoC,eAAA,KAAoB,QAAA;AACpE,KAAK,KAAK,CAAC,aAAA,KAAkB,OAAA,IAAW,KAAK,CAAC,aAAA,KAAkB,gBAAgB;AAChF;AACA;;AAEA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,OAAO,EAA2D;AACtG,EAAE,IAAI;AACN,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;AAC/B,EAAE,EAAE,MAAM;AACV;AACA,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/tracing/utils.ts"],"sourcesContent":["import { WINDOW } from '../helpers';\n\n/**\n * Checks if the baggage header has Sentry values.\n */\nexport function baggageHeaderHasSentryValues(baggageHeader: string): boolean {\n return baggageHeader.split(',').some(value => value.trim().startsWith('sentry-'));\n}\n\n/**\n * Gets the full URL from a given URL string.\n */\nexport function getFullURL(url: string): string | undefined {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Checks if the entry is a PerformanceResourceTiming.\n */\nexport function isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails.\n */\nexport function createHeadersSafely(headers: Record<string, string> | undefined): Headers | undefined {\n try {\n return new Headers(headers);\n } catch {\n // noop\n return undefined;\n }\n}\n"],"names":[],"mappings":";;AAKO,SAAS,6BAA6B,aAAA,EAAgC;AAC3E,EAAA,OAAO,aAAA,CAAc,KAAA,CAAM,GAAG,CAAA,CAAE,IAAA,CAAK,CAAA,KAAA,KAAS,KAAA,CAAM,IAAA,EAAK,CAAE,UAAA,CAAW,SAAS,CAAC,CAAA;AAClF;AAKO,SAAS,WAAW,GAAA,EAAiC;AAC1D,EAAA,IAAI;AAGF,IAAA,MAAM,SAAS,IAAI,GAAA,CAAI,GAAA,EAAK,MAAA,CAAO,SAAS,MAAM,CAAA;AAClD,IAAA,OAAO,MAAA,CAAO,IAAA;AAAA,EAChB,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;AAKO,SAAS,4BAA4B,KAAA,EAA6D;AACvG,EAAA,OACE,KAAA,CAAM,SAAA,KAAc,UAAA,IACpB,eAAA,IAAmB,KAAA,IACnB,OAAQ,KAAA,CAAoC,eAAA,KAAoB,QAAA,KAC/D,KAAA,CAAM,aAAA,KAAkB,OAAA,IAAW,MAAM,aAAA,KAAkB,gBAAA,CAAA;AAEhE;AAKO,SAAS,oBAAoB,OAAA,EAAkE;AACpG,EAAA,IAAI;AACF,IAAA,OAAO,IAAI,QAAQ,OAAO,CAAA;AAAA,EAC5B,CAAA,CAAA,MAAQ;AAEN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -2,26 +2,17 @@ import { createTransport, makePromiseBuffer } from '@sentry/core/browser';
2
2
  import { getNativeImplementation, clearCachedImplementation } from '@sentry-internal/browser-utils';
3
3
 
4
4
  const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE = 40;
5
-
6
- /**
7
- * Creates a Transport that uses the Fetch API to send events to Sentry.
8
- */
9
- function makeFetchTransport(
10
- options,
11
- nativeFetch = getNativeImplementation('fetch'),
12
- ) {
5
+ function makeFetchTransport(options, nativeFetch = getNativeImplementation("fetch")) {
13
6
  let pendingBodySize = 0;
14
7
  let pendingCount = 0;
15
-
16
8
  async function makeRequest(request) {
17
9
  const requestSize = request.body.length;
18
10
  pendingBodySize += requestSize;
19
11
  pendingCount++;
20
-
21
12
  const requestOptions = {
22
13
  body: request.body,
23
- method: 'POST',
24
- referrerPolicy: 'strict-origin',
14
+ method: "POST",
15
+ referrerPolicy: "strict-origin",
25
16
  headers: options.headers,
26
17
  // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to
27
18
  // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)".
@@ -34,34 +25,30 @@ function makeFetchTransport(
34
25
  // We will therefore only activate the flag when we're below that limit.
35
26
  // There is also a limit of requests that can be open at the same time, so we also limit this to 15
36
27
  // See https://github.com/getsentry/sentry-javascript/pull/7553 for details
37
- keepalive: pendingBodySize <= 60000 && pendingCount < 15,
38
- ...options.fetchOptions,
28
+ keepalive: pendingBodySize <= 6e4 && pendingCount < 15,
29
+ ...options.fetchOptions
39
30
  };
40
-
41
31
  try {
42
- // Note: We do not need to suppress tracing here, because we are using the native fetch, instead of our wrapped one.
43
32
  const response = await nativeFetch(options.url, requestOptions);
44
-
45
33
  return {
46
34
  statusCode: response.status,
47
35
  headers: {
48
- 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
49
- 'retry-after': response.headers.get('Retry-After'),
50
- },
36
+ "x-sentry-rate-limits": response.headers.get("X-Sentry-Rate-Limits"),
37
+ "retry-after": response.headers.get("Retry-After")
38
+ }
51
39
  };
52
40
  } catch (e) {
53
- clearCachedImplementation('fetch');
41
+ clearCachedImplementation("fetch");
54
42
  throw e;
55
43
  } finally {
56
44
  pendingBodySize -= requestSize;
57
45
  pendingCount--;
58
46
  }
59
47
  }
60
-
61
48
  return createTransport(
62
49
  options,
63
50
  makeRequest,
64
- makePromiseBuffer(options.bufferSize || DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE),
51
+ makePromiseBuffer(options.bufferSize || DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE)
65
52
  );
66
53
  }
67
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sources":["../../../../../src/transports/fetch.ts"],"sourcesContent":["import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core/browser';\nimport { createTransport, makePromiseBuffer } from '@sentry/core/browser';\nimport { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';\nimport type { WINDOW } from '../helpers';\nimport type { BrowserTransportOptions } from './types';\n\nconst DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE = 40;\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: typeof WINDOW.fetch = getNativeImplementation('fetch'),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n async function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'strict-origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n // Note: We do not need to suppress tracing here, because we are using the native fetch, instead of our wrapped one.\n const response = await nativeFetch(options.url, requestOptions);\n\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n } catch (e) {\n clearCachedImplementation('fetch');\n throw e;\n } finally {\n pendingBodySize -= requestSize;\n pendingCount--;\n }\n }\n\n return createTransport(\n options,\n makeRequest,\n makePromiseBuffer(options.bufferSize || DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE),\n );\n}\n"],"names":[],"mappings":";;;AAMA,MAAM,qCAAA,GAAwC,EAAE;;AAEhD;AACA;AACA;AACO,SAAS,kBAAkB;AAClC,EAAE,OAAO;AACT,EAAE,WAAW,GAAwB,uBAAuB,CAAC,OAAO,CAAC;AACrE,EAAa;AACb,EAAE,IAAI,eAAA,GAAkB,CAAC;AACzB,EAAE,IAAI,YAAA,GAAe,CAAC;;AAEtB,EAAE,eAAe,WAAW,CAAC,OAAO,EAA2D;AAC/F,IAAI,MAAM,WAAA,GAAc,OAAO,CAAC,IAAI,CAAC,MAAM;AAC3C,IAAI,eAAA,IAAmB,WAAW;AAClC,IAAI,YAAY,EAAE;;AAElB,IAAI,MAAM,cAAc,GAAgB;AACxC,MAAM,IAAI,EAAE,OAAO,CAAC,IAAI;AACxB,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,cAAc,EAAE,eAAe;AACrC,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,EAAE,eAAA,IAAmB,SAAU,YAAA,GAAe,EAAE;AAC/D,MAAM,GAAG,OAAO,CAAC,YAAY;AAC7B,KAAK;;AAEL,IAAI,IAAI;AACR;AACA,MAAM,MAAM,QAAA,GAAW,MAAM,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC;;AAErE,MAAM,OAAO;AACb,QAAQ,UAAU,EAAE,QAAQ,CAAC,MAAM;AACnC,QAAQ,OAAO,EAAE;AACjB,UAAU,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,UAAU,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC5D,SAAS;AACT,OAAO;AACP,IAAI,CAAA,CAAE,OAAO,CAAC,EAAE;AAChB,MAAM,yBAAyB,CAAC,OAAO,CAAC;AACxC,MAAM,MAAM,CAAC;AACb,IAAI,UAAU;AACd,MAAM,eAAA,IAAmB,WAAW;AACpC,MAAM,YAAY,EAAE;AACpB,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,eAAe;AACxB,IAAI,OAAO;AACX,IAAI,WAAW;AACf,IAAI,iBAAiB,CAAC,OAAO,CAAC,UAAA,IAAc,qCAAqC,CAAC;AAClF,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"fetch.js","sources":["../../../../../src/transports/fetch.ts"],"sourcesContent":["import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core/browser';\nimport { createTransport, makePromiseBuffer } from '@sentry/core/browser';\nimport { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';\nimport type { WINDOW } from '../helpers';\nimport type { BrowserTransportOptions } from './types';\n\nconst DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE = 40;\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: typeof WINDOW.fetch = getNativeImplementation('fetch'),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n async function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'strict-origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n // Note: We do not need to suppress tracing here, because we are using the native fetch, instead of our wrapped one.\n const response = await nativeFetch(options.url, requestOptions);\n\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n } catch (e) {\n clearCachedImplementation('fetch');\n throw e;\n } finally {\n pendingBodySize -= requestSize;\n pendingCount--;\n }\n }\n\n return createTransport(\n options,\n makeRequest,\n makePromiseBuffer(options.bufferSize || DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE),\n );\n}\n"],"names":[],"mappings":";;;AAMA,MAAM,qCAAA,GAAwC,EAAA;AAKvC,SAAS,kBAAA,CACd,OAAA,EACA,WAAA,GAAmC,uBAAA,CAAwB,OAAO,CAAA,EACvD;AACX,EAAA,IAAI,eAAA,GAAkB,CAAA;AACtB,EAAA,IAAI,YAAA,GAAe,CAAA;AAEnB,EAAA,eAAe,YAAY,OAAA,EAAkE;AAC3F,IAAA,MAAM,WAAA,GAAc,QAAQ,IAAA,CAAK,MAAA;AACjC,IAAA,eAAA,IAAmB,WAAA;AACnB,IAAA,YAAA,EAAA;AAEA,IAAA,MAAM,cAAA,GAA8B;AAAA,MAClC,MAAM,OAAA,CAAQ,IAAA;AAAA,MACd,MAAA,EAAQ,MAAA;AAAA,MACR,cAAA,EAAgB,eAAA;AAAA,MAChB,SAAS,OAAA,CAAQ,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAYjB,SAAA,EAAW,eAAA,IAAmB,GAAA,IAAU,YAAA,GAAe,EAAA;AAAA,MACvD,GAAG,OAAA,CAAQ;AAAA,KACb;AAEA,IAAA,IAAI;AAEF,MAAA,MAAM,QAAA,GAAW,MAAM,WAAA,CAAY,OAAA,CAAQ,KAAK,cAAc,CAAA;AAE9D,MAAA,OAAO;AAAA,QACL,YAAY,QAAA,CAAS,MAAA;AAAA,QACrB,OAAA,EAAS;AAAA,UACP,sBAAA,EAAwB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,sBAAsB,CAAA;AAAA,UACnE,aAAA,EAAe,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,aAAa;AAAA;AACnD,OACF;AAAA,IACF,SAAS,CAAA,EAAG;AACV,MAAA,yBAAA,CAA0B,OAAO,CAAA;AACjC,MAAA,MAAM,CAAA;AAAA,IACR,CAAA,SAAE;AACA,MAAA,eAAA,IAAmB,WAAA;AACnB,MAAA,YAAA,EAAA;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,eAAA;AAAA,IACL,OAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA,CAAkB,OAAA,CAAQ,UAAA,IAAc,qCAAqC;AAAA,GAC/E;AACF;;;;"}
@@ -2,114 +2,71 @@ import { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/
2
2
  import { WINDOW } from '../helpers.js';
3
3
  import { makeFetchTransport } from './fetch.js';
4
4
 
5
- // 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being
6
- // modified and simplified: https://github.com/jakearchibald/idb-keyval
7
- //
8
- // At commit: 0420a704fd6cbb4225429c536b1f61112d012fca
9
- // Original license:
10
-
11
- // Copyright 2016, Jake Archibald
12
- //
13
- // Licensed under the Apache License, Version 2.0 (the "License");
14
- // you may not use this file except in compliance with the License.
15
- // You may obtain a copy of the License at
16
- //
17
- // http://www.apache.org/licenses/LICENSE-2.0
18
- //
19
- // Unless required by applicable law or agreed to in writing, software
20
- // distributed under the License is distributed on an "AS IS" BASIS,
21
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- // See the License for the specific language governing permissions and
23
- // limitations under the License.
24
-
25
5
  function promisifyRequest(request) {
26
6
  return new Promise((resolve, reject) => {
27
- // @ts-expect-error - file size hacks
28
7
  request.oncomplete = request.onsuccess = () => resolve(request.result);
29
- // @ts-expect-error - file size hacks
30
8
  request.onabort = request.onerror = () => reject(request.error);
31
9
  });
32
10
  }
33
-
34
- /** Create or open an IndexedDb store */
35
11
  function createStore(dbName, storeName) {
36
12
  const request = indexedDB.open(dbName);
37
13
  request.onupgradeneeded = () => request.result.createObjectStore(storeName);
38
14
  const dbp = promisifyRequest(request);
39
-
40
- return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
15
+ return (callback) => dbp.then((db) => callback(db.transaction(storeName, "readwrite").objectStore(storeName)));
41
16
  }
42
-
43
17
  function keys(store) {
44
- return promisifyRequest(store.getAllKeys() );
18
+ return promisifyRequest(store.getAllKeys());
45
19
  }
46
-
47
- /** Insert into the end of the store */
48
20
  function push(store, value, maxQueueSize) {
49
- return store(store => {
50
- return keys(store).then(keys => {
51
- if (keys.length >= maxQueueSize) {
21
+ return store((store2) => {
22
+ return keys(store2).then((keys2) => {
23
+ if (keys2.length >= maxQueueSize) {
52
24
  return;
53
25
  }
54
-
55
- // We insert with an incremented key so that the entries are popped in order
56
- store.put(value, Math.max(...keys, 0) + 1);
57
- return promisifyRequest(store.transaction);
26
+ store2.put(value, Math.max(...keys2, 0) + 1);
27
+ return promisifyRequest(store2.transaction);
58
28
  });
59
29
  });
60
30
  }
61
-
62
- /** Insert into the front of the store */
63
31
  function unshift(store, value, maxQueueSize) {
64
- return store(store => {
65
- return keys(store).then(keys => {
66
- if (keys.length >= maxQueueSize) {
32
+ return store((store2) => {
33
+ return keys(store2).then((keys2) => {
34
+ if (keys2.length >= maxQueueSize) {
67
35
  return;
68
36
  }
69
-
70
- // We insert with an decremented key so that the entries are popped in order
71
- store.put(value, Math.min(...keys, 0) - 1);
72
- return promisifyRequest(store.transaction);
37
+ store2.put(value, Math.min(...keys2, 0) - 1);
38
+ return promisifyRequest(store2.transaction);
73
39
  });
74
40
  });
75
41
  }
76
-
77
- /** Pop the oldest value from the store */
78
42
  function shift(store) {
79
- return store(store => {
80
- return keys(store).then(keys => {
81
- const firstKey = keys[0];
43
+ return store((store2) => {
44
+ return keys(store2).then((keys2) => {
45
+ const firstKey = keys2[0];
82
46
  if (firstKey == null) {
83
- return undefined;
47
+ return void 0;
84
48
  }
85
-
86
- return promisifyRequest(store.get(firstKey)).then(value => {
87
- store.delete(firstKey);
88
- return promisifyRequest(store.transaction).then(() => value);
49
+ return promisifyRequest(store2.get(firstKey)).then((value) => {
50
+ store2.delete(firstKey);
51
+ return promisifyRequest(store2.transaction).then(() => value);
89
52
  });
90
53
  });
91
54
  });
92
55
  }
93
-
94
56
  function createIndexedDbStore(options) {
95
57
  let store;
96
-
97
- // Lazily create the store only when it's needed
98
58
  function getStore() {
99
- if (store == undefined) {
100
- store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');
59
+ if (store == void 0) {
60
+ store = createStore(options.dbName || "sentry-offline", options.storeName || "queue");
101
61
  }
102
-
103
62
  return store;
104
63
  }
105
-
106
64
  return {
107
65
  push: async (env) => {
108
66
  try {
109
67
  const serialized = serializeEnvelope(env);
110
68
  await push(getStore(), serialized, options.maxQueueSize || 30);
111
69
  } catch {
112
- //
113
70
  }
114
71
  },
115
72
  unshift: async (env) => {
@@ -117,7 +74,6 @@ function createIndexedDbStore(options) {
117
74
  const serialized = serializeEnvelope(env);
118
75
  await unshift(getStore(), serialized, options.maxQueueSize || 30);
119
76
  } catch {
120
- //
121
77
  }
122
78
  },
123
79
  shift: async () => {
@@ -127,34 +83,21 @@ function createIndexedDbStore(options) {
127
83
  return parseEnvelope(deserialized);
128
84
  }
129
85
  } catch {
130
- //
131
86
  }
132
-
133
- return undefined;
134
- },
87
+ return void 0;
88
+ }
135
89
  };
136
90
  }
137
-
138
- function makeIndexedDbOfflineTransport(
139
- createTransport,
140
- ) {
141
- return options => {
91
+ function makeIndexedDbOfflineTransport(createTransport) {
92
+ return (options) => {
142
93
  const transport = createTransport({ ...options, createStore: createIndexedDbStore });
143
-
144
- WINDOW.addEventListener('online', async _ => {
94
+ WINDOW.addEventListener("online", async (_) => {
145
95
  await transport.flush();
146
96
  });
147
-
148
97
  return transport;
149
98
  };
150
99
  }
151
-
152
- /**
153
- * Creates a transport that uses IndexedDb to store events when offline.
154
- */
155
- function makeBrowserOfflineTransport(
156
- createTransport = makeFetchTransport,
157
- ) {
100
+ function makeBrowserOfflineTransport(createTransport = makeFetchTransport) {
158
101
  return makeIndexedDbOfflineTransport(makeOfflineTransport(createTransport));
159
102
  }
160
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n OfflineStore,\n OfflineTransportOptions,\n Transport,\n} from '@sentry/core/browser';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(make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YAAY,CAAC;AAC5C,QAAQ;AACR,MAAM,EAAE,MAAM;AACd;AACA,MAAM;;AAEN,MAAM,OAAO,SAAS;AACtB,IAAI,CAAC;AACL,GAAG;AACH;;AAEA,SAAS,6BAA6B;AACtC,EAAE,eAAe;AACjB,EAA8D;AAC9D,EAAE,OAAO,WAAW;AACpB,IAAI,MAAM,SAAA,GAAY,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,oBAAA,EAAsB,CAAC;;AAExF,IAAI,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK;AACjD,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE;AAC7B,IAAI,CAAC,CAAC;;AAEN,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,eAAe,GAA8B,kBAAkB;AACjE,EAA8D;AAC9D,EAAE,OAAO,6BAA6B,CAAI,oBAAoB,CAAC,eAAe,CAAC,CAAC;AAChF;;;;"}
1
+ {"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n OfflineStore,\n OfflineTransportOptions,\n Transport,\n} from '@sentry/core/browser';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":["store","keys"],"mappings":";;;;AAiCA,SAAS,iBAAgC,OAAA,EAAqD;AAC5F,EAAA,OAAO,IAAI,OAAA,CAAW,CAAC,OAAA,EAAS,MAAA,KAAW;AAEzC,IAAA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AC,CAAA;AAED,IAAA,OAAO,SAAA;AAAA,EACT,CAAA;AACF;AAKO,SAAS,2BAAA,CACd,kBAA6C,kBAAA,EACe;AAC5D,EAAA,OAAO,6BAAA,CAAiC,oBAAA,CAAqB,eAAe,CAAC,CAAA;AAC/E;;;;"}
@@ -1,37 +1,27 @@
1
1
  import { dsnToString, createEnvelope } from '@sentry/core/browser';
2
2
 
3
- /**
4
- * Creates an envelope from a user feedback.
5
- */
6
- function createUserFeedbackEnvelope(
7
- feedback,
8
- {
9
- metadata,
10
- tunnel,
11
- dsn,
12
- }
13
-
14
- ,
15
- ) {
3
+ function createUserFeedbackEnvelope(feedback, {
4
+ metadata,
5
+ tunnel,
6
+ dsn
7
+ }) {
16
8
  const headers = {
17
9
  event_id: feedback.event_id,
18
- sent_at: new Date().toISOString(),
19
- ...(metadata?.sdk && {
10
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
11
+ ...metadata?.sdk && {
20
12
  sdk: {
21
13
  name: metadata.sdk.name,
22
- version: metadata.sdk.version,
23
- },
24
- }),
25
- ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),
14
+ version: metadata.sdk.version
15
+ }
16
+ },
17
+ ...!!tunnel && !!dsn && { dsn: dsnToString(dsn) }
26
18
  };
27
19
  const item = createUserFeedbackEnvelopeItem(feedback);
28
-
29
20
  return createEnvelope(headers, [item]);
30
21
  }
31
-
32
22
  function createUserFeedbackEnvelopeItem(feedback) {
33
23
  const feedbackHeaders = {
34
- type: 'user_report',
24
+ type: "user_report"
35
25
  };
36
26
  return [feedbackHeaders, feedback];
37
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core/browser';\nimport { createEnvelope, dsnToString } from '@sentry/core/browser';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACvD,GAAG;AACH,EAAE,MAAM,IAAA,GAAO,8BAA8B,CAAC,QAAQ,CAAC;;AAEvD,EAAE,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AACxC;;AAEA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;AACpC;;;;"}
1
+ {"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core/browser';\nimport { createEnvelope, dsnToString } from '@sentry/core/browser';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":[],"mappings":";;AAMO,SAAS,2BACd,QAAA,EACA;AAAA,EACE,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAKe;AACf,EAAA,MAAM,OAAA,GAA4B;AAAA,IAChC,UAAU,QAAA,CAAS,QAAA;AAAA,IACnB,OAAA,EAAA,iBAAS,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAChC,GAAI,UAAU,GAAA,IAAO;AAAA,MACnB,GAAA,EAAK;AAAA,QACH,IAAA,EAAM,SAAS,GAAA,CAAI,IAAA;AAAA,QACnB,OAAA,EAAS,SAAS,GAAA,CAAI;AAAA;AACxB,KACF;AAAA,IACA,GAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAA,EAAK,WAAA,CAAY,GAAG,CAAA;AAAE,GACnD;AACA,EAAA,MAAM,IAAA,GAAO,+BAA+B,QAAQ,CAAA;AAEpD,EAAA,OAAO,cAAA,CAAe,OAAA,EAAS,CAAC,IAAI,CAAC,CAAA;AACvC;AAEA,SAAS,+BAA+B,QAAA,EAA0C;AAChF,EAAA,MAAM,eAAA,GAAuC;AAAA,IAC3C,IAAA,EAAM;AAAA,GACR;AACA,EAAA,OAAO,CAAC,iBAAiB,QAAQ,CAAA;AACnC;;;;"}
@@ -2,54 +2,33 @@ import { consoleSandbox, getLocationHref } from '@sentry/core/browser';
2
2
  import { DEBUG_BUILD } from '../debug-build.js';
3
3
  import { WINDOW } from '../helpers.js';
4
4
 
5
- /**
6
- * Returns true if the SDK is running in an embedded browser extension.
7
- * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.
8
- */
9
5
  function checkAndWarnIfIsEmbeddedBrowserExtension() {
10
6
  if (_isEmbeddedBrowserExtension()) {
11
7
  if (DEBUG_BUILD) {
12
8
  consoleSandbox(() => {
13
- // eslint-disable-next-line no-console
14
9
  console.error(
15
- '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
10
+ "[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/"
16
11
  );
17
12
  });
18
13
  }
19
-
20
14
  return true;
21
15
  }
22
-
23
16
  return false;
24
17
  }
25
-
26
18
  function _isEmbeddedBrowserExtension() {
27
- if (typeof WINDOW.window === 'undefined') {
28
- // No need to show the error if we're not in a browser window environment (e.g. service workers)
19
+ if (typeof WINDOW.window === "undefined") {
29
20
  return false;
30
21
  }
31
-
32
- const _window = WINDOW ;
33
-
34
- // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine
35
- // see: https://github.com/getsentry/sentry-javascript/issues/12668
22
+ const _window = WINDOW;
36
23
  if (_window.nw) {
37
24
  return false;
38
25
  }
39
-
40
- const extensionObject = _window['chrome'] || _window['browser'];
41
-
26
+ const extensionObject = _window["chrome"] || _window["browser"];
42
27
  if (!extensionObject?.runtime?.id) {
43
28
  return false;
44
29
  }
45
-
46
30
  const href = getLocationHref();
47
-
48
- // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage
49
- const isDedicatedExtensionPage =
50
- WINDOW === WINDOW.top &&
51
- /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(href);
52
-
31
+ const isDedicatedExtensionPage = WINDOW === WINDOW.top && /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(href);
53
32
  return !isDedicatedExtensionPage;
54
33
  }
55
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":[],"mappings":";;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAI,WAAW,EAAE;AACrB,MAAM,cAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,KAAK;AACrB,UAAU,mJAAmJ;AAC7J,SAAS;AACT,MAAM,CAAC,CAAC;AACR,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;AAEA,SAAS,2BAA2B,GAAY;AAChD,EAAE,IAAI,OAAO,MAAM,CAAC,MAAA,KAAW,WAAW,EAAE;AAC5C;AACA,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAU,MAAA;;AAElB;AACA;AACA,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE;AAClB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,eAAA,GAAkB,OAAO,CAAC,QAAQ,CAAA,IAAK,OAAO,CAAC,SAAS,CAAC;;AAEjE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAO,eAAe,EAAE;;AAEhC;AACA,EAAE,MAAM,wBAAA;AACR,IAAI,MAAA,KAAW,MAAM,CAAC,GAAA;AACtB,IAAI,oFAAoF,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEnG,EAAE,OAAO,CAAC,wBAAwB;AAClC;;;;"}
1
+ {"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":[],"mappings":";;;;AAmBO,SAAS,wCAAA,GAAoD;AAClE,EAAA,IAAI,6BAA4B,EAAG;AACjC,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,cAAA,CAAe,MAAM;AAEnB,QAAA,OAAA,CAAQ,KAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,KAAA;AACT;AAEA,SAAS,2BAAA,GAAuC;AAC9C,EAAA,IAAI,OAAO,MAAA,CAAO,MAAA,KAAW,WAAA,EAAa;AAExC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,OAAA,GAAU,MAAA;AAIhB,EAAA,IAAI,QAAQ,EAAA,EAAI;AACd,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,eAAA,GAAkB,OAAA,CAAQ,QAAQ,CAAA,IAAK,QAAQ,SAAS,CAAA;AAE9D,EAAA,IAAI,CAAC,eAAA,EAAiB,OAAA,EAAS,EAAA,EAAI;AACjC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,OAAO,eAAA,EAAgB;AAG7B,EAAA,MAAM,2BACJ,MAAA,KAAW,MAAA,CAAO,GAAA,IAClB,oFAAA,CAAqF,KAAK,IAAI,CAAA;AAEhG,EAAA,OAAO,CAAC,wBAAA;AACV;;;;"}