@sentry/replay 11.17.0 → 11.18.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.
@@ -1,8 +1,8 @@
1
1
  import { GLOBAL_OBJ, _INTERNAL_performanceTimeToSeconds, addBreadcrumb, addEventProcessor, captureException, consoleSandbox, createEnvelope, createEventEnvelopeHeaders, debounce as debounce$1, debug as debug$1, defineIntegration, fill, getActiveSpan, getClient, getCurrentScope, getDynamicSamplingContextFromSpan, getIsolationScope, getRootSpan, getSdkMetadataForEnvelopeHeader, isBrowser, isObjectLike, isRateLimited, isSentryRequestUrl, normalize, parseSampleRate, prepareEvent, safeSetSpanJSONAttributes, setContext, severityLevelFromString, spanToJSON, stringMatchesSomePattern, updateRateLimits, uuid4 } from "@sentry/core";
2
2
  import { SENTRY_XHR_DATA_KEY, addClickKeypressInstrumentationHandler, addClsInstrumentationHandler, addHistoryInstrumentationHandler, addInpInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler, getBodyString, getFetchRequestArgBody, getLocationHref, htmlTreeAsString, parseXhrResponseHeaders, serializeFormData, setTimeout as setTimeout$3 } from "@sentry/browser-utils";
3
- // ../../node_modules/.pnpm/@sentry+conventions@0.35.0/node_modules/@sentry/conventions/dist/attributes.mjs
4
- const Qb = "sentry.replay_id";
5
- const og = "sentry.segment.name.source";
3
+ // ../../node_modules/.pnpm/@sentry+conventions@0.36.0/node_modules/@sentry/conventions/dist/attributes.mjs
4
+ const Xb = "sentry.replay_id";
5
+ const pg = "sentry.segment.name.source";
6
6
  // src/constants.ts
7
7
  const WINDOW = GLOBAL_OBJ;
8
8
  const REPLAY_SESSION_KEY = "sentryReplaySession";
@@ -25,7 +25,7 @@ const MIN_REPLAY_DURATION = 4999;
25
25
  const MIN_REPLAY_DURATION_LIMIT = 5e4;
26
26
  /** The max. length of a replay. */
27
27
  const MAX_REPLAY_DURATION = 36e5;
28
- // ../../node_modules/.pnpm/@sentry+rrweb@2.46.0/node_modules/@sentry/rrweb/dist/canvas-manager-BUXy0PTw.js
28
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/canvas-manager-Cdmr3z03.js
29
29
  var __defProp = Object.defineProperty;
30
30
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
31
31
  enumerable: true,
@@ -628,6 +628,7 @@ function serializeTextNode(n, options) {
628
628
  rootId
629
629
  };
630
630
  }
631
+ const warnedTaintedCanvases = /* @__PURE__ */ new WeakSet();
631
632
  function serializeElementNode(n, options) {
632
633
  const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, ignoreCSSAttributes } = options;
633
634
  const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);
@@ -679,7 +680,7 @@ function serializeElementNode(n, options) {
679
680
  if (n.selected && !maskInputOptions["select"]) attributes.selected = true;
680
681
  else delete attributes.selected;
681
682
  }
682
- if (tagName === "canvas" && recordCanvas) {
683
+ if (tagName === "canvas" && recordCanvas) try {
683
684
  if (n.__context === "2d") {
684
685
  if (!is2DCanvasBlank(n)) attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
685
686
  } else if (!("__context" in n)) {
@@ -689,6 +690,11 @@ function serializeElementNode(n, options) {
689
690
  blankCanvas.height = n.height;
690
691
  if (canvasDataURL !== blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality)) attributes.rr_dataURL = canvasDataURL;
691
692
  }
693
+ } catch (err) {
694
+ if (!warnedTaintedCanvases.has(n)) {
695
+ warnedTaintedCanvases.add(n);
696
+ console.warn(`Cannot record canvas pixels! Error: ${err}`);
697
+ }
692
698
  }
693
699
  if (tagName === "img" && inlineImages) {
694
700
  if (!canvasService) {
@@ -1370,7 +1376,7 @@ var CanvasManagerNoop = class {
1370
1376
  addShadowRoot() {}
1371
1377
  resetShadowRoots() {}
1372
1378
  };
1373
- // ../../node_modules/.pnpm/@sentry+rrweb@2.46.0/node_modules/@sentry/rrweb/dist/rrweb.js
1379
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/rrweb.js
1374
1380
  function getIFrameContentDocument(iframe) {
1375
1381
  try {
1376
1382
  return iframe.contentDocument;
@@ -3711,7 +3717,7 @@ function createBreadcrumb(breadcrumb) {
3711
3717
  ...breadcrumb
3712
3718
  };
3713
3719
  }
3714
- // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.46.0/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3720
+ // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.47.0/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3715
3721
  var NodeType = /* @__PURE__ */ ((NodeType2) => {
3716
3722
  NodeType2[NodeType2["Document"] = 0] = "Document";
3717
3723
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
@@ -6249,7 +6255,7 @@ var ReplayContainer = class {
6249
6255
  const lastRootSpan = lastActiveSpan && getRootSpan(lastActiveSpan);
6250
6256
  if (!lastRootSpan) return;
6251
6257
  const spanJson = spanToJSON(lastRootSpan);
6252
- const source = spanJson.attributes[og];
6258
+ const source = spanJson.attributes[pg];
6253
6259
  if (!source || !["route", "custom"].includes(source)) return;
6254
6260
  return spanJson.name;
6255
6261
  }
@@ -6830,7 +6836,7 @@ var Replay = class {
6830
6836
  processSpan(span) {
6831
6837
  const replayId = this.getReplayId(true);
6832
6838
  if (replayId) {
6833
- safeSetSpanJSONAttributes(span, { [Qb]: replayId });
6839
+ safeSetSpanJSONAttributes(span, { [Xb]: replayId });
6834
6840
  if (this.getRecordingMode() === "buffer") safeSetSpanJSONAttributes(span, { "sentry._internal.replay_is_buffering": true });
6835
6841
  }
6836
6842
  }