diff --git a/options/options.js b/options/options.js index d7734da..296425f 100644 --- a/options/options.js +++ b/options/options.js @@ -110,10 +110,13 @@ }); input.click(); }); - let json = JSON.parse(text); + const json = JSON.parse(text); while (settingsMigration.transitions.hasOwnProperty(json.storageVersion)){ - let oldVersion = json.storageVersion; - json = settingsMigration.transitions[json.storageVersion](json); + const oldVersion = json.storageVersion; + const modifiedData = settingsMigration.transitions[json.storageVersion](json); + Object.keys(modifiedData).forEach(function(key){ + json[key] = modifiedData[key]; + }); if (oldVersion === json.storageVersion){ break; } @@ -129,7 +132,9 @@ } }); keys.forEach(function(key){ - settings[key] = json[key]; + if (key !== "storageVersion"){ + settings[key] = json[key]; + } }); }, resetSettings: async function(){ diff --git a/releaseNotes.txt b/releaseNotes.txt index 88be1a4..fd02d3c 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -17,6 +17,7 @@ Version 1.0: - added window.open protection - cross origin DOM manipulations - window.name protection was detectable + - importing settings file with an older storage version did not work properly known issues: - if a data URL is blocked the page action button does not appear