Disabled reset settings on update. Bump version => 2.2.1

This commit is contained in:
ManeraKai 2022-06-20 16:47:49 +03:00
parent a3621dea6d
commit ed84d92598
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
4 changed files with 17 additions and 21 deletions

View File

@ -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

View File

@ -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();
// }
}
)

View File

@ -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()

View File

@ -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>