about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--chromium.md6
-rw-r--r--src/pages/background/background.js27
-rw-r--r--src/pages/options/widgets/general.js3
-rw-r--r--src/updates/updates.xml2
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 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
     <app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'>
-        <updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.2.0/libredirect-2.2.0.crx' version='2.2.0' />
+        <updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.2.1/libredirect-2.2.1.crx' version='2.2.1' />
     </app>
 </gupdate>