aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/content_scripts/notify.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/content_scripts/notify.ts b/src/content_scripts/notify.ts
index 726b5aed4..166b1c6a8 100644
--- a/src/content_scripts/notify.ts
+++ b/src/content_scripts/notify.ts
@@ -257,8 +257,15 @@ function init() {
return;
}
if (document.documentElement.getAttribute("data-taler-nojs")) {
- initStyle();
- setStyles(true);
+ const onload = () => {
+ initStyle();
+ setStyles(true);
+ };
+ if (document.readyState == "complete") {
+ onload();
+ } else {
+ document.addEventListener("DOMContentLoaded", onload);
+ }
}
registerHandlers();
// Hack to know when the extension is unloaded