Added support for Chromium Sync https://github.com/libredirect/browser_extension/issues/838
This commit is contained in:
parent
8c3c716d1b
commit
e21da3ec14
|
@ -68,14 +68,14 @@ importSettingsElement.addEventListener("change", () => {
|
||||||
const exportSettingsSync = document.getElementById("export-settings-sync")
|
const exportSettingsSync = document.getElementById("export-settings-sync")
|
||||||
const importSettingsSync = document.getElementById("import-settings-sync")
|
const importSettingsSync = document.getElementById("import-settings-sync")
|
||||||
const importSettingsSyncText = document.getElementById("import_settings_sync_text")
|
const importSettingsSyncText = document.getElementById("import_settings_sync_text")
|
||||||
if (!isChrome) {
|
|
||||||
exportSettingsSync.addEventListener("click", async () => {
|
exportSettingsSync.addEventListener("click", async () => {
|
||||||
let options = await utils.getOptions()
|
let options = await utils.getOptions()
|
||||||
options.version = browser.runtime.getManifest().version
|
options.version = browser.runtime.getManifest().version
|
||||||
browser.storage.sync.set({ options }, () => location.reload())
|
browser.storage.sync.set({ options }, () => location.reload())
|
||||||
})
|
})
|
||||||
|
|
||||||
importSettingsSync.addEventListener("click", () => {
|
importSettingsSync.addEventListener("click", () => {
|
||||||
function importError() {
|
function importError() {
|
||||||
importSettingsSyncText.innerHTML = '<span style="color:red;">Error!</span>'
|
importSettingsSyncText.innerHTML = '<span style="color:red;">Error!</span>'
|
||||||
setTimeout(() => (importSettingsSyncText.innerHTML = oldHTML), 1000)
|
setTimeout(() => (importSettingsSyncText.innerHTML = oldHTML), 1000)
|
||||||
|
@ -90,12 +90,7 @@ if (!isChrome) {
|
||||||
importError()
|
importError()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
exportSettingsSync.style.display = 'none'
|
|
||||||
importSettingsSync.style.display = 'none'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const resetSettings = document.getElementById("reset-settings")
|
const resetSettings = document.getElementById("reset-settings")
|
||||||
resetSettings.addEventListener("click", async () => {
|
resetSettings.addEventListener("click", async () => {
|
||||||
|
|
Loading…
Reference in New Issue