Skip to content

Commit

Permalink
Return early for child same origin frames (rrweb-io#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
colingm authored May 29, 2024
1 parent 4014305 commit d7cf8dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-plants-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rrweb': patch
---

Return early for child same origin frames
5 changes: 5 additions & 0 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ function record<T = eventWithTime>(
if (inEmittingFrame && !emit) {
throw new Error('emit function is required');
}
if (!inEmittingFrame && !passEmitsToParent) {
return () => {
/* no-op since in this case we don't need to record anything from this frame in particular */
};
}
// move departed options to new options
if (mousemoveWait !== undefined && sampling.mousemove === undefined) {
sampling.mousemove = mousemoveWait;
Expand Down

0 comments on commit d7cf8dd

Please sign in to comment.