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