From d2a3774b979e48d53ba224408892043e8b647dce Mon Sep 17 00:00:00 2001 From: Santiago Morales Date: Tue, 14 Jul 2026 17:45:16 -0500 Subject: [PATCH] Fix blank iframe after remount --- navigator/src/epub/frame/FrameManager.ts | 2 +- navigator/src/epub/fxl/FXLFrameManager.ts | 4 ++-- navigator/src/webpub/WebPubFrameManager.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/navigator/src/epub/frame/FrameManager.ts b/navigator/src/epub/frame/FrameManager.ts index 507f98be..57042bfa 100644 --- a/navigator/src/epub/frame/FrameManager.ts +++ b/navigator/src/epub/frame/FrameManager.ts @@ -66,7 +66,7 @@ export class FrameManager { this.frame.onerror = (err) => { try { rej(err); } catch (error) {} } - this.frame.contentWindow!.location.replace(this.source); + this.frame.src = this.source; }); } diff --git a/navigator/src/epub/fxl/FXLFrameManager.ts b/navigator/src/epub/fxl/FXLFrameManager.ts index 51e908ae..16ed3740 100644 --- a/navigator/src/epub/fxl/FXLFrameManager.ts +++ b/navigator/src/epub/fxl/FXLFrameManager.ts @@ -99,7 +99,7 @@ export class FXLFrameManager { try { rej(e.error); this.loadPromise = undefined; } catch (error) {}; }, { once: true }); this.frame.style.removeProperty("display"); - this.frame.contentWindow!.location.replace(this.source); + this.frame.src = this.source; }); return this.loadPromise; } @@ -187,7 +187,7 @@ export class FXLFrameManager { try { this.showPromise = undefined; rej(e.error); } catch (error) {}; }, { once: true }); this.source = "about:blank"; - this.frame.contentWindow!.location.replace("about:blank"); + this.frame.src = this.source; this.frame.style.display = "none"; }); } diff --git a/navigator/src/webpub/WebPubFrameManager.ts b/navigator/src/webpub/WebPubFrameManager.ts index 4a36e1d4..7c53d8e9 100644 --- a/navigator/src/webpub/WebPubFrameManager.ts +++ b/navigator/src/webpub/WebPubFrameManager.ts @@ -64,7 +64,7 @@ export class WebPubFrameManager { this.frame.onerror = (err) => { try { rej(err); } catch (error) {} } - this.frame.contentWindow!.location.replace(this.source); + this.frame.src = this.source; }); }