aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-27 02:31:32 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-27 02:31:32 +0200
commit68e44e0e80635b00333ef2fcbb0ad937581344ba (patch)
tree2cc6a6eed3ca45dadd79a7126cd0024bfe3f7edd /src
parent3c563c78d47318ca65d3cc41c50b8d665635fcf7 (diff)
fix style initialization
Diffstat (limited to 'src')
-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