1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Add button to reload extension if update pending

For #522
This commit is contained in:
kkapsner 2021-01-26 21:45:15 +01:00
parent 8e5986817e
commit a5558b4144
7 changed files with 38 additions and 1 deletions

View File

@ -194,6 +194,19 @@
"description": "" "description": ""
}, },
"reloadExtension_title": {
"message": "Reload extension",
"description": ""
},
"reloadExtension_description": {
"message": "Perform a pending update.",
"description": ""
},
"reloadExtension_label": {
"message": "Reload",
"description": ""
},
"hideSetting": { "hideSetting": {
"message": "Click here to hide this setting.", "message": "Click here to hide this setting.",
"description": "" "description": ""

View File

@ -218,6 +218,9 @@
browser.runtime.reload(); browser.runtime.reload();
}, 1000); }, 1000);
} }
else {
settings.updatePending = true;
}
}); });
} }
logging.message("end"); logging.message("end");

View File

@ -412,6 +412,11 @@
name: "disruptSessionOnUpdate", name: "disruptSessionOnUpdate",
defaultValue: false defaultValue: false
}, },
{
name: "updatePending",
resetOnStartup: true,
defaultValue: false
},
{ {
name: "isStillDefault", name: "isStillDefault",
defaultValue: true defaultValue: true

View File

@ -20,6 +20,9 @@
const mobile = require("../lib/mobile"); const mobile = require("../lib/mobile");
const callbacks = { const callbacks = {
reloadExtension: function(){
browser.runtime.reload();
},
openNavigatorSettings: function(){ openNavigatorSettings: function(){
logging.verbose("open navigator settings"); logging.verbose("open navigator settings");
window.open("navigator.html", "_blank"); window.open("navigator.html", "_blank");

View File

@ -19,6 +19,11 @@
{ {
"name": "disruptSessionOnUpdate" "name": "disruptSessionOnUpdate"
}, },
{
"name": "reloadExtension",
"actions": ["reloadExtension",],
"displayDependencies": [{"updatePending": [true]}]
},
] ]
}, },
{ {

View File

@ -4,7 +4,7 @@ Version 1.6:
new features: new features:
- try to not break tabs when updating - try to not break tabs when updating
- setting to postpone updates until browser restart - setting to postpone updates until browser restart or extension is reloaded
fixes: fixes:
- fix message canvasBlocker-unload - fix message canvasBlocker-unload

View File

@ -169,6 +169,14 @@
{ {
"version": "1.6Alpha20210118", "version": "1.6Alpha20210118",
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.6Alpha20210118-an+fx.xpi" "update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.6Alpha20210118-an+fx.xpi"
},
{
"version": "1.6Alpha20210126",
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.6Alpha20210126-an+fx.xpi"
},
{
"version": "1.6Alpha20210127",
"update_link": "https://canvasblocker.kkapsner.de/versions/canvasblocker_beta-1.6Alpha20210127-an+fx.xpi"
} }
] ]
} }