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

Resetting the settings had undesired side effects

This commit is contained in:
kkapsner 2019-12-02 19:13:38 +01:00
parent c62ddcc33f
commit 5020e0b070
3 changed files with 16 additions and 13 deletions

View File

@ -20,7 +20,7 @@
// eslint-disable-next-line no-unused-vars
"": function(oldStorage){
return {
storageVersion: 0.5
storageVersion: 0.6
};
},
0.1: function(oldStorage){

View File

@ -141,21 +141,23 @@
alert(error);
});
},
resetSettings: function(){
modal.confirm(
extension.getTranslation("resetSettings_confirm"),
{
node: this,
selector: ".settingRow .content"
}
).then(function(clear){
resetSettings: async function(){
try {
const clear = await modal.confirm(
extension.getTranslation("resetSettings_confirm"),
{
node: this,
selector: ".settingRow .content"
}
);
if (clear){
browser.storage.local.clear();
await browser.storage.local.clear();
await browser.storage.local.set({storageVersion: settings.storageVersion});
}
return;
}).catch(function(error){
}
catch (error){
logging.warning("Unable to reset settings:", error);
});
}
}
};

View File

@ -10,6 +10,7 @@ Version 0.5.15:
- background color of the textarea in the settings export was not readable in the dark theme when the value was invalid
- settings sanitation: added missing APIs
- navigator.oscpu and navigator.buildID are undefined in non Gecko browsers
- resetting the settings had undesired side effects
known issues:
- if a data URL is blocked the page action button does not appear