mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
e48710eee9
commit
8e5986817e
5 changed files with 39 additions and 1 deletions
21
lib/main.js
21
lib/main.js
|
@ -199,5 +199,26 @@
|
|||
});
|
||||
});
|
||||
}
|
||||
if (browser.runtime.onUpdateAvailable){
|
||||
browser.runtime.onUpdateAvailable.addListener(async function(details){
|
||||
logging.message("Update available", details);
|
||||
if (settings.disruptSessionOnUpdate){
|
||||
await Promise.all((await browser.tabs.query({})).map(async function(tab){
|
||||
try{
|
||||
await browser.tabs.sendMessage(tab.id, {
|
||||
"canvasBlocker-unload": true
|
||||
});
|
||||
}
|
||||
catch(error){
|
||||
logging.verbose("error while unloading", tab, ":", error);
|
||||
}
|
||||
}));
|
||||
window.setTimeout(function(){
|
||||
logging.verbose("Reload extension after one second");
|
||||
browser.runtime.reload();
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
logging.message("end");
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue