mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
parent
e48710eee9
commit
8e5986817e
@ -185,6 +185,15 @@
|
|||||||
"description": ""
|
"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": {
|
"hideSetting": {
|
||||||
"message": "Click here to hide this setting.",
|
"message": "Click here to hide this setting.",
|
||||||
"description": ""
|
"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");
|
logging.message("end");
|
||||||
}());
|
}());
|
||||||
|
@ -408,6 +408,10 @@
|
|||||||
name: "dontShowOptionsOnUpdate",
|
name: "dontShowOptionsOnUpdate",
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "disruptSessionOnUpdate",
|
||||||
|
defaultValue: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "isStillDefault",
|
name: "isStillDefault",
|
||||||
defaultValue: true
|
defaultValue: true
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
{
|
{
|
||||||
"name": "blockMode"
|
"name": "blockMode"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "disruptSessionOnUpdate"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,8 @@ Version 1.6:
|
|||||||
-
|
-
|
||||||
|
|
||||||
new features:
|
new features:
|
||||||
-
|
- try to not break tabs when updating
|
||||||
|
- setting to postpone updates until browser restart
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
- fix message canvasBlocker-unload
|
- fix message canvasBlocker-unload
|
||||||
|
Loading…
x
Reference in New Issue
Block a user