From ed84d92598ff622a9f5a88ef0ce61e01e1598c2c Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Mon, 20 Jun 2022 16:47:49 +0300 Subject: Disabled reset settings on update. Bump version => 2.2.1 --- chromium.md | 6 +++--- src/pages/background/background.js | 27 ++++++++++++--------------- src/pages/options/widgets/general.js | 3 +-- src/updates/updates.xml | 2 +- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/chromium.md b/chromium.md index 0e09f554..1825d782 100644 --- a/chromium.md +++ b/chromium.md @@ -1,5 +1,5 @@ ## Linux -- Download the latest `.crx` file: [libredirect-2.2.0.crx](https://github.com/libredirect/libredirect/releases/download/v2.2.0/libredirect-2.2.0.crx) +- Download the latest `.crx` file: [libredirect-2.2.1.crx](https://github.com/libredirect/libredirect/releases/download/v2.2.1/libredirect-2.2.1.crx) - Open `chrome://extensions` - Enable `dev mode` - Rerfesh the page @@ -8,11 +8,11 @@ Updates are automatic ## Windows, MacOS -- Download the latest release [libredirect-2.2.0.zip](https://github.com/libredirect/libredirect/releases/download/v2.2.0/libredirect-2.2.0.zip) +- Download the latest release [libredirect-2.2.1.zip](https://github.com/libredirect/libredirect/releases/download/v2.2.1/libredirect-2.2.1.zip) - Unzip it with `Auto detect subfolder` - Open `chrome://extensions` - Enable `dev mode` -- Click `Load unpacked`. Select and Open `libredirect-2.2.0/` +- Click `Load unpacked`. Select and Open `libredirect-2.2.1/` https://user-images.githubusercontent.com/40805353/159987051-8be73cd3-3fdf-4dd0-99d4-8886674fbdb6.mp4 diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 5fef360a..8f2bf2ba 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -59,22 +59,19 @@ browser.runtime.onInstalled.addListener( }); }) }; - function initDefault() { + if (details.reason == 'install') initDefaults(); - } - - // if (details.reason == 'install') { - if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { - if (details.reason == "update") - browser.storage.local.get(null, r => { - if (r.theme) { - const old = encodeURIComponent(JSON.stringify(r)) - browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); - } - initDefaults(); - }) - else initDefaults(); - } + // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { + // if (details.reason == "update") + // browser.storage.local.get(null, r => { + // if (r.theme) { + // const old = encodeURIComponent(JSON.stringify(r)) + // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); + // } + // initDefaults(); + // }) + // else initDefaults(); + // } } ) diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 04568aa5..721ad2b0 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -49,7 +49,7 @@ function exportSettings() { } exportSettings(); -browser.storage.onChanged.addListener(exportSettings); +document.getElementById('general_page').addEventListener('click', exportSettings) let importSettingsElement = document.getElementById("import-settings"); let importSettingsElementText = document.getElementById('import_settings_text'); @@ -93,7 +93,6 @@ importSettingsElement.addEventListener("change", }) }); - } else { console.log('incompatible settings'); importError() diff --git a/src/updates/updates.xml b/src/updates/updates.xml index d10a617f..4bdc45b4 100644 --- a/src/updates/updates.xml +++ b/src/updates/updates.xml @@ -1,6 +1,6 @@ - + -- cgit 1.4.1