fix the statement which is getting changed by Microbundle (#1156)

* fix the statement which is getting changed by microbundle

* Create chatty-cherries-train.md

* fix formatting.

* fix position of comment

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
Pravin Tiwari
2026-04-01 12:00:00 +08:00
committed by GitHub
parent acffc1a1e2
commit 7dca0f37c4
2 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'rrweb': patch
---
Fix the statement which is getting changed by Microbundle

View File

@@ -94,8 +94,10 @@ function record<T = eventWithTime>(
let passEmitsToParent = false;
if (!inEmittingFrame) {
try {
window.parent.document; // throws if parent is cross-origin
passEmitsToParent = false; // if parent is same origin we collect iframe events from the parent
// throws if parent is cross-origin
if (window.parent.document) {
passEmitsToParent = false; // if parent is same origin we collect iframe events from the parent
}
} catch (e) {
passEmitsToParent = true;
}