From 52d048ece3607e76320d09e18200b8c809d32ef9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Feb 2021 21:01:10 +0530 Subject: [PATCH] Viewer: Also send a load event to the window object after the iframe loads --- src/pyj/read_book/iframe.pyj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index f7fef6334d..3a26259ace 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -459,6 +459,9 @@ class IframeBoss: window.setTimeout(self.update_cfi, 0) window.setTimeout(self.update_toc_position, 0) + load_event = document.createEvent('Event') + load_event.initEvent('load', False, False) + window.dispatchEvent(load_event) def calculate_progress_frac(self): current_name = current_spine_item().name