From 1849943d48d175d78b00d7d8e894284191b14d37 Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Fixes https://github.com/rrweb-io/rrweb/issues/567 (#78) --- src/snapshot.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/snapshot.ts b/src/snapshot.ts index 065feb1e..c6249eba 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -327,7 +327,9 @@ function onceIframeLoaded( iframeEl.src === blankUrl || iframeEl.src === '' ) { - listener(); + // iframe was already loaded, make sure we wait to trigger the listener + // till _after_ the mutation that found this iframe has had time to process + setTimeout(listener, 0); return; } // use default listener