Skip to content

[Bug]: In Replay, Cross-origin iframe goes blank after parent takes fullSnapshot #1720

@hannadrehman

Description

@hannadrehman

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

v2.0.0-alpha.18

Expected Behavior

When using recordCrossOriginIframes: true, if the parent frame triggers a FullSnapshot (checkout) after the iframe has already loaded and is sending back events to the parent, the replay consistently shows the iframe going blank after that snapshot.

This appears to happen because rrweb merges the child events via postMessage but does not synchronize the FullSnapshots between the parent and child. When the parent is reset during its FullSnapshot, the iframe context is wiped, and subsequent child events can’t be player in the DOM correctly.

Expected behavior

• The iframe DOM should remain visible and continue updating after the parent’s FullSnapshot.
• Child iframe snapshots/events should be synchronized with the parent snapshot so the replay doesn’t lose context.

Actual Behavior

• Immediately after the parent’s FullSnapshot, the iframe goes blank in the replay.
• All child events after that snapshot fail to render (but are present in the event array).

Steps to Reproduce

  1. Set up a parent page that:
rrweb.record({
  recordCrossOriginIframes: true,
  emit: (e) => events.push(e),
  checkoutEveryNms: 45000 // Force a FullSnapshot every 45s
});
  1. Embed a cross-origin iframe that runs:
rrweb.record({
  recordCrossOriginIframes: true,
  checkoutEveryNms: 45000 // optional here. but keeping for now. 
  emit: () => {} // child auto-postMessages to parent
});

3.Start recording, interact with the iframe.
4.Wait for the parent’s checkout (FullSnapshot) after ~45 seconds.
5. Replay the events using rrweb-player package.
6. after 45 seconds. the iframe playback goes blank

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions