@sentry/rrweb-player 2.44.0 → 2.44.1

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.
@@ -4666,7 +4666,7 @@ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
4666
4666
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
4667
4667
  return NodeType2;
4668
4668
  })(NodeType$2 || {});
4669
- function isElement(n2) {
4669
+ function isElement$1(n2) {
4670
4670
  return n2.nodeType === n2.ELEMENT_NODE;
4671
4671
  }
4672
4672
  class Mirror {
@@ -4698,6 +4698,9 @@ class Mirror {
4698
4698
  (childNode) => this.removeNodeFromMap(childNode)
4699
4699
  );
4700
4700
  }
4701
+ if (isElement$1(n2) && n2.shadowRoot) {
4702
+ this.removeNodeFromMap(n2.shadowRoot);
4703
+ }
4701
4704
  }
4702
4705
  has(id) {
4703
4706
  return this.idNodeMap.has(id);
@@ -5531,7 +5534,7 @@ function buildNodeWithSN(n2, options) {
5531
5534
  console.warn("Failed to rebuild", childN);
5532
5535
  continue;
5533
5536
  }
5534
- if (childN.isShadow && isElement(node) && node.shadowRoot) {
5537
+ if (childN.isShadow && isElement$1(node) && node.shadowRoot) {
5535
5538
  node.shadowRoot.appendChild(childNode);
5536
5539
  } else if (n2.type === NodeType$2.Document && childN.type == NodeType$2.Element) {
5537
5540
  const htmlElement = childNode;
@@ -5806,8 +5809,9 @@ function getImplementation(name) {
5806
5809
  if (cached) {
5807
5810
  return cached;
5808
5811
  }
5812
+ const windowImpl = window[name].bind(window);
5813
+ let impl = windowImpl;
5809
5814
  const document2 = window.document;
5810
- let impl = window[name];
5811
5815
  if (document2 && typeof document2.createElement === "function") {
5812
5816
  try {
5813
5817
  const sandbox = document2.createElement("iframe");
@@ -5815,16 +5819,21 @@ function getImplementation(name) {
5815
5819
  document2.head.appendChild(sandbox);
5816
5820
  const contentWindow = sandbox.contentWindow;
5817
5821
  if (contentWindow && contentWindow[name]) {
5818
- impl = // eslint-disable-next-line @typescript-eslint/unbound-method
5819
- contentWindow[name];
5822
+ const sandboxImpl = contentWindow[name].bind(window);
5823
+ impl = (...args) => {
5824
+ try {
5825
+ return sandboxImpl(...args);
5826
+ } catch {
5827
+ cachedImplementations[name] = windowImpl;
5828
+ return windowImpl(...args);
5829
+ }
5830
+ };
5820
5831
  }
5821
5832
  document2.head.removeChild(sandbox);
5822
5833
  } catch (e2) {
5823
5834
  }
5824
5835
  }
5825
- return cachedImplementations[name] = impl.bind(
5826
- window
5827
- );
5836
+ return cachedImplementations[name] = impl;
5828
5837
  }
5829
5838
  function onRequestAnimationFrame(...rest) {
5830
5839
  return getImplementation("requestAnimationFrame")(...rest);
@@ -5953,6 +5962,9 @@ var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
5953
5962
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
5954
5963
  return NodeType2;
5955
5964
  })(NodeType$1 || {});
5965
+ function isElement(n2) {
5966
+ return n2.nodeType === n2.ELEMENT_NODE;
5967
+ }
5956
5968
  let Mirror$1 = class Mirror2 {
5957
5969
  constructor() {
5958
5970
  __publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
@@ -5982,6 +5994,9 @@ let Mirror$1 = class Mirror2 {
5982
5994
  (childNode) => this.removeNodeFromMap(childNode)
5983
5995
  );
5984
5996
  }
5997
+ if (isElement(n2) && n2.shadowRoot) {
5998
+ this.removeNodeFromMap(n2.shadowRoot);
5999
+ }
5985
6000
  }
5986
6001
  has(id) {
5987
6002
  return this.idNodeMap.has(id);