diff --git a/package.json b/package.json index dd63b92d..ccd37afc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb", - "version": "0.7.10", + "version": "0.7.11", "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/record/observer.ts b/src/record/observer.ts index 18f560db..41d6604b 100644 --- a/src/record/observer.ts +++ b/src/record/observer.ts @@ -156,7 +156,7 @@ function initMutationObserver( : mirror.getId(n.previousSibling as INode), nextId: !n.nextSibling ? n.nextSibling - : mirror.getId(n.nextSibling as INode), + : mirror.getId((n.nextSibling as unknown) as INode), node: serializeNodeWithId(n, document, mirror.map, blockClass, true)!, }); } else { diff --git a/src/replay/index.ts b/src/replay/index.ts index c9b55f77..adbb2822 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -302,7 +302,7 @@ export class Replayer { this.pause(); this.emitter.emit(ReplayerEvents.LoadStylesheetStart); timer = window.setTimeout(() => { - this.resume(); + this.resume(this.timer.timeOffset); // mark timer was called timer = -1; }, this.config.loadTimeout); @@ -311,7 +311,7 @@ export class Replayer { css.addEventListener('load', () => { unloadSheets.delete(css); if (unloadSheets.size === 0 && timer !== -1) { - this.resume(); + this.resume(this.timer.timeOffset); this.emitter.emit(ReplayerEvents.LoadStylesheetEnd); if (timer) { window.clearTimeout(timer); diff --git a/typings/types.d.ts b/typings/types.d.ts index 4be126f3..17f8fabe 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -214,6 +214,7 @@ export declare enum ReplayerEvents { LoadStylesheetStart = "load-stylesheet-start", LoadStylesheetEnd = "load-stylesheet-end", SkipStart = "skip-start", - SkipEnd = "skip-end" + SkipEnd = "skip-end", + MouseInteraction = "mouse-interaction" } export {};