@glimt/record 0.0.53 → 0.0.54

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.
@@ -462,6 +462,9 @@ const index = {
462
462
  const shouldTryAnonymousFetchingOnCorsError$1 = () => {
463
463
  return !("_rrweb_skip_re_fetching_to_suppress_cors_errors" in window && window._rrweb_skip_re_fetching_to_suppress_cors_errors === true);
464
464
  };
465
+ const isDebug$1 = () => {
466
+ return "_rrweb_is_debug" in window && window._rrweb_is_debug ? window._rrweb_is_debug : false;
467
+ };
465
468
  function isElement(n2) {
466
469
  return n2.nodeType === n2.ELEMENT_NODE;
467
470
  }
@@ -1565,9 +1568,10 @@ function serializeElementNode(n2, options) {
1565
1568
  return;
1566
1569
  }
1567
1570
  } else {
1568
- console.warn(
1569
- `Cannot inline img src=${imageSrc}! Error: ${err}`
1570
- );
1571
+ if (isDebug$1())
1572
+ console.warn(
1573
+ `Cannot inline img src=${imageSrc}! Error: ${err}`
1574
+ );
1571
1575
  }
1572
1576
  }
1573
1577
  inlineImageCleanup();
@@ -1723,7 +1727,7 @@ function serializeNodeWithId(n2, options) {
1723
1727
  cssCaptured
1724
1728
  });
1725
1729
  if (!_serializedNode) {
1726
- console.warn(n2, "not serialized");
1730
+ if (isDebug$1()) console.warn(n2, "not serialized");
1727
1731
  return null;
1728
1732
  }
1729
1733
  let id;
@@ -12710,6 +12714,9 @@ class StylesheetManager {
12710
12714
  trackStylesheetInLinkElement(_linkEl) {
12711
12715
  }
12712
12716
  }
12717
+ const isDebug = () => {
12718
+ return "_rrweb_is_debug" in window && window._rrweb_is_debug ? window._rrweb_is_debug : false;
12719
+ };
12713
12720
  let wrappedEmit;
12714
12721
  let takeFullSnapshot$1;
12715
12722
  let canvasManager;
@@ -12722,7 +12729,7 @@ try {
12722
12729
  document.body.removeChild(cleanFrame);
12723
12730
  }
12724
12731
  } catch (err) {
12725
- console.debug("Unable to override Array.from", err);
12732
+ if (isDebug()) console.debug("Unable to override Array.from", err);
12726
12733
  }
12727
12734
  const mirror = createMirror$2();
12728
12735
  function record(options = {}) {
@@ -12997,7 +13004,8 @@ function record(options = {}) {
12997
13004
  keepIframeSrcFn
12998
13005
  });
12999
13006
  if (!node2) {
13000
- return console.warn("Failed to snapshot the document");
13007
+ if (isDebug()) console.warn("Failed to snapshot the document");
13008
+ return;
13001
13009
  }
13002
13010
  wrappedEmit(
13003
13011
  {
@@ -13136,7 +13144,10 @@ function record(options = {}) {
13136
13144
  try {
13137
13145
  handlers.push(observe(iframeEl.contentDocument));
13138
13146
  } catch (error) {
13139
- console.warn(error);
13147
+ if (isDebug()) {
13148
+ console.warn("internal error");
13149
+ console.warn(error);
13150
+ }
13140
13151
  }
13141
13152
  });
13142
13153
  let initedAt = null;
@@ -13195,7 +13206,10 @@ function record(options = {}) {
13195
13206
  unregisterErrorHandler();
13196
13207
  };
13197
13208
  } catch (error) {
13198
- console.warn(error);
13209
+ if (isDebug()) {
13210
+ console.warn("internal error1");
13211
+ console.warn(error);
13212
+ }
13199
13213
  }
13200
13214
  }
13201
13215
  record.addCustomEvent = (tag, payload) => {