diff --git a/package.json b/package.json index 6833c1e3..a2eb2596 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb", - "version": "0.9.5", + "version": "0.9.6", "description": "record and replay the web", "scripts": { "test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts", diff --git a/src/replay/index.ts b/src/replay/index.ts index 21be60cf..d545e11c 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -330,7 +330,7 @@ export class Replayer { this.iframe.contentDocument, ); - polyfill(this.iframe.contentWindow); + polyfill(this.iframe.contentWindow as Window & typeof globalThis); } } @@ -894,7 +894,7 @@ export class Replayer { parentInDocument = this.iframe.contentDocument.contains(parent); } else if (this.iframe.contentDocument.body.contains) { // fix for IE - // refer 'Internet Explorer notes' at https://developer.mozilla.org/zh-CN/docs/Web/API/Document + // refer 'Internet Explorer notes' at https://developer.mozilla.org/zh-CN/docs/Web/API/Document parentInDocument = this.iframe.contentDocument.body.contains(parent); } diff --git a/src/utils.ts b/src/utils.ts index 9cf592d4..4f43f8d2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -314,7 +314,7 @@ export class TreeIndex { const node = mirror.getNode(id); node?.childNodes.forEach((childNode) => { if ('__sn' in childNode) { - deepRemoveFromMirror(((childNode as unknown) as INode).__sn.id) + deepRemoveFromMirror(((childNode as unknown) as INode).__sn.id); } }); }; diff --git a/typings/utils.d.ts b/typings/utils.d.ts index 7d6fc9f1..8fd73f85 100644 --- a/typings/utils.d.ts +++ b/typings/utils.d.ts @@ -12,7 +12,7 @@ export declare function getWindowWidth(): number; export declare function isBlocked(node: Node | null, blockClass: blockClass): boolean; export declare function isAncestorRemoved(target: INode): boolean; export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent; -export declare function polyfill(): void; +export declare function polyfill(win?: Window & typeof globalThis): void; export declare function needCastInSyncMode(event: eventWithTime): boolean; export declare type TreeNode = { id: number;