diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-04-26 03:14:31 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-04-26 03:14:31 +0200 |
commit | a787cf2f6ca939c8166070bd1addd43f66b0bce6 (patch) | |
tree | 466cb152d30a46fd02a63e01c81ffac23b00fa04 /src/content_scripts/notify.ts | |
parent | 79a2eed5589468c2df3e4ee2d190d9fc43b80fe9 (diff) | |
download | wallet-core-a787cf2f6ca939c8166070bd1addd43f66b0bce6.tar.xz |
only add styles if the page requested it
Diffstat (limited to 'src/content_scripts/notify.ts')
-rw-r--r-- | src/content_scripts/notify.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/content_scripts/notify.ts b/src/content_scripts/notify.ts index a0f76cf26..726b5aed4 100644 --- a/src/content_scripts/notify.ts +++ b/src/content_scripts/notify.ts @@ -256,15 +256,19 @@ function init() { window.setTimeout(init, 200); return; } - initStyle(); - setStyles(true); + if (document.documentElement.getAttribute("data-taler-nojs")) { + initStyle(); + setStyles(true); + } registerHandlers(); // Hack to know when the extension is unloaded let port = chrome.runtime.connect(); port.onDisconnect.addListener(() => { logVerbose && console.log("chrome runtime disconnected, removing handlers"); - setStyles(false); + if (document.documentElement.getAttribute("data-taler-nojs")) { + setStyles(false); + } for (let handler of handlers) { document.removeEventListener(handler.type, handler.listener); } |