Return early for child same origin frames (#1295)

This commit is contained in:
Colin Maxfield
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 1b79b5b6c2
commit bade29531a
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
'rrweb': patch
---
Return early for child same origin frames

View File

@@ -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;