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

Importing settings file with an very old storage version did not work at all

This commit is contained in:
kkapsner 2020-01-26 00:51:18 +01:00
parent 350c7b65d4
commit 64b60c834a
2 changed files with 8 additions and 5 deletions

View File

@ -122,15 +122,17 @@
} }
} }
delete json.storageVersion; delete json.storageVersion;
const keys = Object.keys(json); const keys = Object.keys(json).filter(function(key){
keys.forEach(function(key){
const setting = settings.getDefinition(key); const setting = settings.getDefinition(key);
if (!settings){ if (!setting){
throw new Error("Unknown setting " + key + "."); logging.error("Unknown setting " + key + ".");
return false;
} }
if (!setting.fixed && setting.invalid(json[key])){ if (!setting.fixed && setting.invalid(json[key])){
throw new Error("Invalid value " + json[key] + " for " + key + "."); logging.error("Invalid value " + json[key] + " for " + key + ".");
return false;
} }
return true;
}); });
keys.forEach(function(key){ keys.forEach(function(key){
settings[key] = json[key]; settings[key] = json[key];

View File

@ -9,6 +9,7 @@ Version 1.1:
fixes: fixes:
- error when exporting function with name "top" - error when exporting function with name "top"
- tabs opened with window.open broke when the parent tab was reloaded/closed - tabs opened with window.open broke when the parent tab was reloaded/closed
- importing settings file with an very old storage version did not work at all
known issues: known issues:
- if a data URL is blocked the page action button does not appear - if a data URL is blocked the page action button does not appear