@posthog/rrweb-record 0.0.32 → 0.0.34
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.
- package/dist/rrweb-record.cjs +38 -2
- package/dist/rrweb-record.cjs.map +1 -1
- package/dist/rrweb-record.js +38 -2
- package/dist/rrweb-record.js.map +1 -1
- package/dist/rrweb-record.umd.cjs +38 -2
- package/dist/rrweb-record.umd.cjs.map +2 -2
- package/dist/rrweb-record.umd.min.cjs +35 -35
- package/dist/rrweb-record.umd.min.cjs.map +3 -3
- package/package.json +1 -1
package/dist/rrweb-record.js
CHANGED
|
@@ -879,6 +879,7 @@ function hrefFrom(n2) {
|
|
|
879
879
|
return n2.href;
|
|
880
880
|
}
|
|
881
881
|
function serializeElementNode(n2, options) {
|
|
882
|
+
var _a2, _b;
|
|
882
883
|
const {
|
|
883
884
|
doc,
|
|
884
885
|
blockClass,
|
|
@@ -1052,11 +1053,13 @@ function serializeElementNode(n2, options) {
|
|
|
1052
1053
|
}
|
|
1053
1054
|
}
|
|
1054
1055
|
if (needBlock) {
|
|
1055
|
-
const { width, height } = n2.getBoundingClientRect();
|
|
1056
|
+
const { width, height, left, top } = n2.getBoundingClientRect();
|
|
1056
1057
|
attributes = {
|
|
1057
1058
|
class: attributes.class,
|
|
1058
1059
|
rr_width: `${width}px`,
|
|
1059
|
-
rr_height: `${height}px
|
|
1060
|
+
rr_height: `${height}px`,
|
|
1061
|
+
rr_left: `${Math.floor(left + (((_a2 = doc.defaultView) == null ? void 0 : _a2.scrollX) || 0))}px`,
|
|
1062
|
+
rr_top: `${Math.floor(top + (((_b = doc.defaultView) == null ? void 0 : _b.scrollY) || 0))}px`
|
|
1060
1063
|
};
|
|
1061
1064
|
}
|
|
1062
1065
|
if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {
|
|
@@ -11501,6 +11504,7 @@ class IframeManager {
|
|
|
11501
11504
|
__publicField(this, "recordCrossOriginIframes");
|
|
11502
11505
|
__publicField(this, "messageHandler");
|
|
11503
11506
|
__publicField(this, "nestedIframeListeners", /* @__PURE__ */ new Map());
|
|
11507
|
+
__publicField(this, "attachedIframes", /* @__PURE__ */ new Map());
|
|
11504
11508
|
this.mutationCb = options.mutationCb;
|
|
11505
11509
|
this.wrappedEmit = options.wrappedEmit;
|
|
11506
11510
|
this.stylesheetManager = options.stylesheetManager;
|
|
@@ -11529,6 +11533,7 @@ class IframeManager {
|
|
|
11529
11533
|
}
|
|
11530
11534
|
attachIframe(iframeEl, childSn) {
|
|
11531
11535
|
var _a2;
|
|
11536
|
+
this.attachedIframes.set(iframeEl, childSn);
|
|
11532
11537
|
this.mutationCb({
|
|
11533
11538
|
adds: [
|
|
11534
11539
|
{
|
|
@@ -11584,6 +11589,7 @@ class IframeManager {
|
|
|
11584
11589
|
const rootId = e2.data.node.id;
|
|
11585
11590
|
this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
|
|
11586
11591
|
this.patchRootIdOnNode(e2.data.node, rootId);
|
|
11592
|
+
this.attachedIframes.set(iframeEl, e2.data.node);
|
|
11587
11593
|
return {
|
|
11588
11594
|
timestamp: e2.timestamp,
|
|
11589
11595
|
type: EventType.IncrementalSnapshot,
|
|
@@ -11726,6 +11732,32 @@ class IframeManager {
|
|
|
11726
11732
|
});
|
|
11727
11733
|
}
|
|
11728
11734
|
}
|
|
11735
|
+
reattachIframes() {
|
|
11736
|
+
this.attachedIframes.forEach((content, iframe) => {
|
|
11737
|
+
if (!iframe.isConnected) {
|
|
11738
|
+
this.attachedIframes.delete(iframe);
|
|
11739
|
+
return;
|
|
11740
|
+
}
|
|
11741
|
+
const parentId = this.mirror.getId(iframe);
|
|
11742
|
+
if (parentId === -1) {
|
|
11743
|
+
this.attachedIframes.delete(iframe);
|
|
11744
|
+
return;
|
|
11745
|
+
}
|
|
11746
|
+
this.mutationCb({
|
|
11747
|
+
adds: [
|
|
11748
|
+
{
|
|
11749
|
+
parentId,
|
|
11750
|
+
nextId: null,
|
|
11751
|
+
node: content
|
|
11752
|
+
}
|
|
11753
|
+
],
|
|
11754
|
+
removes: [],
|
|
11755
|
+
texts: [],
|
|
11756
|
+
attributes: [],
|
|
11757
|
+
isAttachIframe: true
|
|
11758
|
+
});
|
|
11759
|
+
});
|
|
11760
|
+
}
|
|
11729
11761
|
destroy() {
|
|
11730
11762
|
if (this.recordCrossOriginIframes) {
|
|
11731
11763
|
window.removeEventListener("message", this.messageHandler);
|
|
@@ -11736,6 +11768,7 @@ class IframeManager {
|
|
|
11736
11768
|
this.nestedIframeListeners.clear();
|
|
11737
11769
|
this.crossOriginIframeMirror.reset();
|
|
11738
11770
|
this.crossOriginIframeStyleMirror.reset();
|
|
11771
|
+
this.attachedIframes.clear();
|
|
11739
11772
|
}
|
|
11740
11773
|
}
|
|
11741
11774
|
class ShadowDomManager {
|
|
@@ -12818,6 +12851,9 @@ function record(options = {}) {
|
|
|
12818
12851
|
isCheckout
|
|
12819
12852
|
);
|
|
12820
12853
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
12854
|
+
if (recordCrossOriginIframes) {
|
|
12855
|
+
iframeManager.reattachIframes();
|
|
12856
|
+
}
|
|
12821
12857
|
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
12822
12858
|
stylesheetManager.adoptStyleSheets(
|
|
12823
12859
|
document.adoptedStyleSheets,
|