mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
parent
e48710eee9
commit
8e5986817e
@ -185,6 +185,15 @@
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"disruptSessionOnUpdate_title": {
|
||||
"message": "Disrupt session on update",
|
||||
"description": ""
|
||||
},
|
||||
"disruptSessionOnUpdate_description": {
|
||||
"message": "If set to true the extension will update as soon as the update is available. This might break some tabs that are currently open.",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"hideSetting": {
|
||||
"message": "Click here to hide this setting.",
|
||||
"description": ""
|
||||
|
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");
|
||||
}());
|
||||
|
@ -408,6 +408,10 @@
|
||||
name: "dontShowOptionsOnUpdate",
|
||||
defaultValue: false
|
||||
},
|
||||
{
|
||||
name: "disruptSessionOnUpdate",
|
||||
defaultValue: false
|
||||
},
|
||||
{
|
||||
name: "isStillDefault",
|
||||
defaultValue: true
|
||||
|
@ -16,6 +16,9 @@
|
||||
{
|
||||
"name": "blockMode"
|
||||
},
|
||||
{
|
||||
"name": "disruptSessionOnUpdate"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -3,7 +3,8 @@ Version 1.6:
|
||||
-
|
||||
|
||||
new features:
|
||||
-
|
||||
- try to not break tabs when updating
|
||||
- setting to postpone updates until browser restart
|
||||
|
||||
fixes:
|
||||
- fix message canvasBlocker-unload
|
||||
|
Loading…
x
Reference in New Issue
Block a user