diff --git a/core/main.js b/core/main.js index 26c545b2..c592e028 100644 --- a/core/main.js +++ b/core/main.js @@ -65,7 +65,6 @@ main._initializeSettings = function () { }); } - stateManager.selectedIcon = items.selectedIcon; wrappers.setIcon({ 'path': stateManager.selectedIcon @@ -90,14 +89,22 @@ main._showReleaseNotes = function (details) { } }); } else if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) { - storageManager.type.get([Setting.LAST_MAPPING_UPDATE, Setting.UPDATE_NOTIFICATION], function (items) { + storageManager.type.get(null, function (items) { let mappingUpdate = items.lastMappingUpdate !== mappings.lastMappingUpdate; + // Remove old keys + for (const key of Object.keys(items)) { + if (!(key in SettingDefaults)) { + delete items[key]; + } + } + // Override old value https://codeberg.org/nobody/LocalCDN/issues/177 + items.xhrTestDomain = 'localcdn.org'; + // Updated mappings.js if (mappingUpdate) { - storageManager.type.set({ - [Setting.LAST_MAPPING_UPDATE]: mappings.lastMappingUpdate - }); + items.lastMappingUpdate = mappings.lastMappingUpdate; + storageManager.type.set(items); } if ( (mappingUpdate && items.updateNotification == 1) || items.updateNotification == 2 ) { diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 36461b76..8d1b300b 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,7 +25,7 @@ New in LocalCDN: