From adbe96ca0025b6aa1379640807ed7b7e2a3eef33 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 19 Apr 2022 17:16:56 +1000 Subject: [PATCH] Load page script after body created (#1802) document.body must exist by the time the top level Svelte component initializes. https://forums.ankiweb.net/t/2-1-50-editor-wont-show-when-addons-load-many-js-files/19036 --- qt/aqt/webview.py | 6 ++++-- ts/page.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 7892853a4..955893e83 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -499,7 +499,7 @@ html {{ {font} }} from aqt import mw - head = mw.baseHTML() + csstxt + jstxt + web_content.head + head = mw.baseHTML() + csstxt + web_content.head body_class = theme_manager.body_class() if theme_manager.night_mode: @@ -520,7 +520,9 @@ html {{ {font} }} {head} -{web_content.body} + +{jstxt} +{web_content.body} """ # print(html) self.setHtml(html) diff --git a/ts/page.html b/ts/page.html index 577569617..39acc6792 100644 --- a/ts/page.html +++ b/ts/page.html @@ -4,7 +4,7 @@ - +