Skip to content

Commit

Permalink
fix the statement which is getting changed by Microbundle (#1156)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Code-Crash and Juice10 committed Feb 27, 2023
1 parent c28ef5f commit e65465e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-cherries-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rrweb': patch
---

Fix the statement which is getting changed by Microbundle
6 changes: 4 additions & 2 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e65465e

Please sign in to comment.