From a7a6d205e1f5aa47970d299c5011695f75874fcc Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 11 Sep 2026 23:23:10 +0200 Subject: [PATCH] fix(iframe): stop observing when the iframe's first location is cross-origin observeIframeNavigation read iframe.contentWindow.location.href once, outside any guard. For a cross-origin iframe that read throws a SecurityError, which escaped as an uncaught exception and never reached the polling loop, whose own read of the same property is already guarded. The first read is now guarded as well, and the observer returns because it cannot follow a cross-origin frame anyway. Co-Authored-By: Claude Opus 5 (1M context) --- app/static/js/iframe.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/static/js/iframe.js b/app/static/js/iframe.js index 72332c5..17f96dd 100644 --- a/app/static/js/iframe.js +++ b/app/static/js/iframe.js @@ -168,7 +168,12 @@ function observeIframeNavigation() { const iframe = mainElement.querySelector("iframe"); if (!iframe || !iframe.contentWindow) return; - let lastUrl = iframe.contentWindow.location.href; + let lastUrl; + try { + lastUrl = iframe.contentWindow.location.href; + } catch (e) { + return; + } setInterval(() => { try {