Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit d7cf8dd

Browse files
authored
Return early for child same origin frames (rrweb-io#1295)
1 parent 4014305 commit d7cf8dd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/silent-plants-perform.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'rrweb': patch
3+
---
4+
5+
Return early for child same origin frames

packages/rrweb/src/record/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ function record<T = eventWithTime>(
122122
if (inEmittingFrame && !emit) {
123123
throw new Error('emit function is required');
124124
}
125+
if (!inEmittingFrame && !passEmitsToParent) {
126+
return () => {
127+
/* no-op since in this case we don't need to record anything from this frame in particular */
128+
};
129+
}
125130
// move departed options to new options
126131
if (mousemoveWait !== undefined && sampling.mousemove === undefined) {
127132
sampling.mousemove = mousemoveWait;

0 commit comments

Comments
 (0)