only add styles if the page requested it
This commit is contained in:
parent
79a2eed558
commit
a787cf2f6c
@ -256,15 +256,19 @@ function init() {
|
|||||||
window.setTimeout(init, 200);
|
window.setTimeout(init, 200);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
initStyle();
|
if (document.documentElement.getAttribute("data-taler-nojs")) {
|
||||||
setStyles(true);
|
initStyle();
|
||||||
|
setStyles(true);
|
||||||
|
}
|
||||||
registerHandlers();
|
registerHandlers();
|
||||||
// Hack to know when the extension is unloaded
|
// Hack to know when the extension is unloaded
|
||||||
let port = chrome.runtime.connect();
|
let port = chrome.runtime.connect();
|
||||||
|
|
||||||
port.onDisconnect.addListener(() => {
|
port.onDisconnect.addListener(() => {
|
||||||
logVerbose && console.log("chrome runtime disconnected, removing handlers");
|
logVerbose && console.log("chrome runtime disconnected, removing handlers");
|
||||||
setStyles(false);
|
if (document.documentElement.getAttribute("data-taler-nojs")) {
|
||||||
|
setStyles(false);
|
||||||
|
}
|
||||||
for (let handler of handlers) {
|
for (let handler of handlers) {
|
||||||
document.removeEventListener(handler.type, handler.listener);
|
document.removeEventListener(handler.type, handler.listener);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user