From 1cec65f565511e89684f3afe11b521ca9b644dcc Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Only trigger waitForStylesheetLoad if not seeking (#326) --- src/replay/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 67cd7f8d..65ab27eb 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -332,7 +332,7 @@ export class Replayer { break; case EventType.FullSnapshot: castFn = () => { - this.rebuildFullSnapshot(event); + this.rebuildFullSnapshot(event, isSync); this.iframe.contentWindow!.scrollTo(event.data.initialOffset); }; break; @@ -398,6 +398,7 @@ export class Replayer { private rebuildFullSnapshot( event: fullSnapshotEvent & { timestamp: number }, + isSync: boolean = false ) { if (!this.iframe.contentDocument) { return console.warn('Looks like your replayer has been destroyed.'); @@ -420,7 +421,7 @@ export class Replayer { (styleEl.sheet! as CSSStyleSheet).insertRule(injectStylesRules[idx], idx); } this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded, event); - this.waitForStylesheetLoad(); + if (!isSync) this.waitForStylesheetLoad(); if (this.config.UNSAFE_replayCanvas) { this.preloadAllImages(); }