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;
const keys = Object.keys(json);
keys.forEach(function(key){
const keys = Object.keys(json).filter(function(key){
const setting = settings.getDefinition(key);
if (!settings){
throw new Error("Unknown setting " + key + ".");
if (!setting){
logging.error("Unknown setting " + key + ".");
return false;
}
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){
settings[key] = json[key];

View File

@ -9,6 +9,7 @@ Version 1.1:
fixes:
- error when exporting function with name "top"
- 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:
- if a data URL is blocked the page action button does not appear