Skip to content

Commit 3328fcf

Browse files
committed
Add emitFromIframe option for iframe in iframe
1 parent 0bceef6 commit 3328fcf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/rrweb/src/record/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function record<T = eventWithTime>(
8989
recordDOM = true,
9090
recordCanvas = false,
9191
recordCrossOriginIframes = false,
92+
emitFromIframe = false,
9293
recordAfter = options.recordAfter === 'DOMContentLoaded'
9394
? options.recordAfter
9495
: 'load',
@@ -103,7 +104,9 @@ function record<T = eventWithTime>(
103104

104105
registerErrorHandler(errorHandler);
105106

106-
const inEmittingFrame = recordCrossOriginIframes
107+
const inEmittingFrame = emitFromIframe
108+
? true
109+
: recordCrossOriginIframes
107110
? window.parent === window
108111
: true;
109112

packages/rrweb/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export type recordOptions<T> = {
6565
recordDOM?: boolean;
6666
recordCanvas?: boolean;
6767
recordCrossOriginIframes?: boolean;
68+
emitFromIframe?: boolean;
6869
recordAfter?: 'DOMContentLoaded' | 'load';
6970
userTriggeredOnInput?: boolean;
7071
collectFonts?: boolean;

0 commit comments

Comments
 (0)