rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

fix: rrweb recorder may throw error when stopping recording after an iframe becomes cross-origin

Open YunFeng0817 opened this issue 11 months ago • 4 comments

The CI failure can be solved by #1696

YunFeng0817 avatar May 27 '25 21:05 YunFeng0817

🦋 Changeset detected

Latest commit: b88b3fed439c0d91d84413b5b739e0c7fd2a0bcf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
rrweb Patch
rrweb-snapshot Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/all Patch
@rrweb/replay Patch
@rrweb/record Patch
@rrweb/types Patch
@rrweb/packer Patch
@rrweb/utils Patch
@rrweb/web-extension Patch
rrvideo Patch
@rrweb/rrweb-plugin-console-record Patch
@rrweb/rrweb-plugin-console-replay Patch
@rrweb/rrweb-plugin-sequential-id-record Patch
@rrweb/rrweb-plugin-sequential-id-replay Patch
@rrweb/rrweb-plugin-canvas-webrtc-record Patch
@rrweb/rrweb-plugin-canvas-webrtc-replay Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 27 '25 21:05 changeset-bot[bot]

When an iframe changes src, do we not record this change and pull in new contents? Does that bit work ok (i.e. contents would be recorded as being blanked out as far as we are concerned because we can't see them?)

eoghanmurray avatar Jun 06 '25 13:06 eoghanmurray

@eoghanmurray Once the iframe's src is changed, we can not record change to this iframe anymore. I just tested and mutation observer can not even detect the change of this src attribute change. The iframe in the player will always display the status from before the src attribute changed. So we can not do much work for this case but at least our code should not fail to stop.

YunFeng0817 avatar Jun 06 '25 18:06 YunFeng0817

I've checked and the MutationObserver can detect external changes like iframeEl.src = 'xyz.com'; However what I think you are referring to is if the iframe itself changes the frame location using internal document.location = 'redirect.com' ? Point taken in any case

eoghanmurray avatar Jun 13 '25 15:06 eoghanmurray