diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 8436a583ec..ef590e418e 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -25,6 +25,7 @@ import { scrollCallback, canvasMutationParam, adoptedStyleSheetParam, + IWindow, } from '../types'; import { IframeManager } from './iframe-manager'; import { ShadowDomManager } from './shadow-dom-manager'; @@ -71,11 +72,12 @@ function record( userTriggeredOnInput = false, collectFonts = false, inlineImages = false, - window: win = window, + window: _win = window, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), } = options; + const win = (_win as unknown) as IWindow; // runtime checks for user options if (!emit) { @@ -251,7 +253,7 @@ function record( canvasManager = new CanvasManager({ recordCanvas, mutationCb: wrappedCanvasMutationEmit, - win: win, + win, blockClass, blockSelector, mirror, @@ -281,6 +283,7 @@ function record( stylesheetManager, canvasManager, keepIframeSrcFn, + window: win, }, mirror, });