From 6594f62f5d5b1cb1964b8325d877d7150d857803 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 29 Apr 2019 16:41:47 +1000 Subject: [PATCH] fix stuck webview issue A race condition could cause domDone to get stuck on false, causing any further bridge messages and setHtml() calls to be ignored. Fix the issue by clearing pending actions and resetting domDone when setting HTML. --- aqt/webview.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aqt/webview.py b/aqt/webview.py index 20498b15b..9c1f42026 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -170,6 +170,9 @@ class AnkiWebView(QWebEngineView): pass def setHtml(self, html): + # discard any previous pending actions + self._pendingActions = [] + self._domDone = True self._queueAction("setHtml", html) def _setHtml(self, html):