@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,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _sentry_core = require("@sentry/core");
3
3
  let _sentry_browser_utils = require("@sentry/browser-utils");
4
- // ../../node_modules/.pnpm/@sentry+conventions@0.35.0/node_modules/@sentry/conventions/dist/attributes.mjs
5
- const Qb = "sentry.replay_id";
6
- const og = "sentry.segment.name.source";
4
+ // ../../node_modules/.pnpm/@sentry+conventions@0.36.0/node_modules/@sentry/conventions/dist/attributes.mjs
5
+ const Xb = "sentry.replay_id";
6
+ const pg = "sentry.segment.name.source";
7
7
  // src/constants.ts
8
8
  const WINDOW = _sentry_core.GLOBAL_OBJ;
9
9
  const REPLAY_SESSION_KEY = "sentryReplaySession";
@@ -26,7 +26,7 @@ const MIN_REPLAY_DURATION = 4999;
26
26
  const MIN_REPLAY_DURATION_LIMIT = 5e4;
27
27
  /** The max. length of a replay. */
28
28
  const MAX_REPLAY_DURATION = 36e5;
29
- // ../../node_modules/.pnpm/@sentry+rrweb@2.46.0/node_modules/@sentry/rrweb/dist/canvas-manager-BUXy0PTw.js
29
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/canvas-manager-Cdmr3z03.js
30
30
  var __defProp = Object.defineProperty;
31
31
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
32
32
  enumerable: true,
@@ -629,6 +629,7 @@ function serializeTextNode(n, options) {
629
629
  rootId
630
630
  };
631
631
  }
632
+ const warnedTaintedCanvases = /* @__PURE__ */ new WeakSet();
632
633
  function serializeElementNode(n, options) {
633
634
  const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, ignoreCSSAttributes } = options;
634
635
  const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);
@@ -680,7 +681,7 @@ function serializeElementNode(n, options) {
680
681
  if (n.selected && !maskInputOptions["select"]) attributes.selected = true;
681
682
  else delete attributes.selected;
682
683
  }
683
- if (tagName === "canvas" && recordCanvas) {
684
+ if (tagName === "canvas" && recordCanvas) try {
684
685
  if (n.__context === "2d") {
685
686
  if (!is2DCanvasBlank(n)) attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
686
687
  } else if (!("__context" in n)) {
@@ -690,6 +691,11 @@ function serializeElementNode(n, options) {
690
691
  blankCanvas.height = n.height;
691
692
  if (canvasDataURL !== blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality)) attributes.rr_dataURL = canvasDataURL;
692
693
  }
694
+ } catch (err) {
695
+ if (!warnedTaintedCanvases.has(n)) {
696
+ warnedTaintedCanvases.add(n);
697
+ console.warn(`Cannot record canvas pixels! Error: ${err}`);
698
+ }
693
699
  }
694
700
  if (tagName === "img" && inlineImages) {
695
701
  if (!canvasService) {
@@ -1371,7 +1377,7 @@ var CanvasManagerNoop = class {
1371
1377
  addShadowRoot() {}
1372
1378
  resetShadowRoots() {}
1373
1379
  };
1374
- // ../../node_modules/.pnpm/@sentry+rrweb@2.46.0/node_modules/@sentry/rrweb/dist/rrweb.js
1380
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/rrweb.js
1375
1381
  function getIFrameContentDocument(iframe) {
1376
1382
  try {
1377
1383
  return iframe.contentDocument;
@@ -3712,7 +3718,7 @@ function createBreadcrumb(breadcrumb) {
3712
3718
  ...breadcrumb
3713
3719
  };
3714
3720
  }
3715
- // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.46.0/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3721
+ // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.47.0/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3716
3722
  var NodeType = /* @__PURE__ */ ((NodeType2) => {
3717
3723
  NodeType2[NodeType2["Document"] = 0] = "Document";
3718
3724
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
@@ -6250,7 +6256,7 @@ var ReplayContainer = class {
6250
6256
  const lastRootSpan = lastActiveSpan && (0, _sentry_core.getRootSpan)(lastActiveSpan);
6251
6257
  if (!lastRootSpan) return;
6252
6258
  const spanJson = (0, _sentry_core.spanToJSON)(lastRootSpan);
6253
- const source = spanJson.attributes[og];
6259
+ const source = spanJson.attributes[pg];
6254
6260
  if (!source || !["route", "custom"].includes(source)) return;
6255
6261
  return spanJson.name;
6256
6262
  }
@@ -6831,7 +6837,7 @@ var Replay = class {
6831
6837
  processSpan(span) {
6832
6838
  const replayId = this.getReplayId(true);
6833
6839
  if (replayId) {
6834
- (0, _sentry_core.safeSetSpanJSONAttributes)(span, { [Qb]: replayId });
6840
+ (0, _sentry_core.safeSetSpanJSONAttributes)(span, { [Xb]: replayId });
6835
6841
  if (this.getRecordingMode() === "buffer") (0, _sentry_core.safeSetSpanJSONAttributes)(span, { "sentry._internal.replay_is_buffering": true });
6836
6842
  }
6837
6843
  }