Skip to content

Commit

Permalink
define takeFullSnapshot before use + setter for takeFullSnapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
megboehlert committed May 15, 2024
1 parent 168e606 commit 6663625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/rrweb/src/record/iframe-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class IframeManager {
}
}

public setTakeFullSnapshot (takeFullSnapshot: (isCheckout?: boolean) => void) {
this.takeFullSnapshot = takeFullSnapshot;
}

public addIframe(iframeEl: HTMLIFrameElement) {
this.iframes.set(iframeEl, true);
if (iframeEl.contentWindow)
Expand Down
4 changes: 2 additions & 2 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import {
} from './error-handler';

let wrappedEmit!: (e: eventWithoutTime, isCheckout?: boolean) => void;

let takeFullSnapshot!: (isCheckout?: boolean) => void;
let takeFullSnapshot: (isCheckout?: boolean) => void = () => { /* no-op */ };
let canvasManager!: CanvasManager;
let recording = false;

Expand Down Expand Up @@ -418,6 +417,7 @@ function record<T = eventWithTime>(
mirror.getId(document),
);
};
iframeManager.setTakeFullSnapshot(takeFullSnapshot);

try {
const handlers: listenerHandler[] = [];
Expand Down

0 comments on commit 6663625

Please sign in to comment.