From a3f4c961a55bacf1b2c7a26530fa86edb98ee272 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Oct 2024 17:34:15 +0530 Subject: [PATCH] Use window.parent rather than window.top to access iframe's parent This prevents a cross origin error if the page is embedded inside a third party iframe. --- src/pyj/book_list/book_details.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index 95b4c7188c..f0cd0f885b 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -127,7 +127,7 @@ def setup_iframe(iframe): a.setAttribute('target', '_parent') def forward_touch_events(ev): - container = window.top.document.getElementById(render_book.container_id) + container = window.parent.document.getElementById(render_book.container_id) if container: dup = v'new ev.constructor(ev.type, ev)' container.dispatchEvent(dup)