From fe81da9b8aa4f2e7a094062bf2b6d4b67640f5bd Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Thu, 16 Jul 2020 19:56:57 +0200 Subject: [PATCH] Make sure to set domDone to False before loading URLs Fixes an issue where JS would be evaluated prematurely in views directly loaded from URLs. --- qt/aqt/webview.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 814ad2d0e..98d802e05 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -300,6 +300,11 @@ class AnkiWebView(QWebEngineView): if oldFocus: oldFocus.setFocus() + def load(self, url: QUrl): + # allow queuing actions when loading url directly + self._domDone = False + super().load(url) + def zoomFactor(self) -> float: # overridden scale factor? webscale = os.environ.get("ANKI_WEBSCALE")