Skip to content

Commit

Permalink
fix: some nested cross-origin iframes can't be recorded
Browse files Browse the repository at this point in the history
  • Loading branch information
YunFeng0817 committed Nov 13, 2023
1 parent 8aea5b0 commit b8c367b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-carrots-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rrweb': patch
---

Fix: some nested cross-origin iframes can't be recorded
8 changes: 8 additions & 0 deletions packages/rrweb/src/record/iframe-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ export class IframeManager {
attributes: [],
isAttachIframe: true,
});

// Listen for messages from cross-origin IFrames that are nested in this iframe.
if (this.recordCrossOriginIframes)
iframeEl.contentWindow?.addEventListener(
'message',
this.handleMessage.bind(this),
);

this.loadListener?.(iframeEl);

if (
Expand Down

0 comments on commit b8c367b

Please sign in to comment.