diff --git a/src/record/iframe-manager.ts b/src/record/iframe-manager.ts index b5eefc59..1825c178 100644 --- a/src/record/iframe-manager.ts +++ b/src/record/iframe-manager.ts @@ -30,6 +30,7 @@ export class IframeManager { removes: [], texts: [], attributes: [], + isAttachIframe: true, }); this.loadListener?.((iframeEl as unknown) as HTMLIFrameElement); } diff --git a/src/record/index.ts b/src/record/index.ts index 70333c07..b6e378d4 100644 --- a/src/record/index.ts +++ b/src/record/index.ts @@ -157,6 +157,14 @@ function record( lastFullSnapshotEvent = e; incrementalSnapshotCount = 0; } else if (e.type === EventType.IncrementalSnapshot) { + // attch iframe should be considered as full snapshot + if ( + e.data.source === IncrementalSource.Mutation && + e.data.isAttachIframe + ) { + return; + } + incrementalSnapshotCount++; const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth; diff --git a/src/types.ts b/src/types.ts index cdcc4164..e9fa13d6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -168,7 +168,7 @@ export type SamplingStrategy = Partial<{ * number is the throttle threshold of mouse/touch move callback */ mousemoveCallback: number; - /** + /** * false means not to record mouse interaction events * can also specify record some kinds of mouse interactions */ @@ -297,6 +297,7 @@ type mutationCallbackParam = { attributes: attributeMutation[]; removes: removedNodeMutation[]; adds: addedNodeMutation[]; + isAttachIframe?: true; }; export type mutationCallBack = (m: mutationCallbackParam) => void;