Update options.js

This commit is contained in:
Yumi Izumi 2020-11-09 00:03:45 +09:00 committed by GitHub
parent 7f18b0a4a9
commit deab58f015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,7 @@ let disableInvidious = document.getElementById("disable-invidious");
let disableBibliogram = document.getElementById("disable-bibliogram");
let disableOsm = document.getElementById("disable-osm");
let disableOldReddit = document.getElementById("disable-old-reddit");
let disableSearchEngine = document.getElementById("disable-searchEngine");
let alwaysProxy = document.getElementById("always-proxy");
let onlyEmbeddedVideo = document.getElementById("only-embed");
let videoQuality = document.getElementById("video-quality");
@ -127,6 +128,7 @@ browser.storage.sync.get(
"disableBibliogram",
"disableOsm",
"disableOldReddit",
"disableSearchEngine",
"alwaysProxy",
"onlyEmbeddedVideo",
"videoQuality",
@ -157,6 +159,7 @@ browser.storage.sync.get(
disableBibliogram.checked = !result.disableBibliogram;
disableOsm.checked = !result.disableOsm;
disableOldReddit.checked = !result.disableOldReddit;
disableSearchEngine.checked = !result.disableSearchEngine;
alwaysProxy.checked = result.alwaysProxy;
onlyEmbeddedVideo.checked = result.onlyEmbeddedVideo;
videoQuality.value = result.videoQuality || "";
@ -335,6 +338,10 @@ disableOldReddit.addEventListener("change", (event) => {
browser.storage.sync.set({ disableOldReddit: !event.target.checked });
});
disableSearchEngine.addEventListener("change", (event) => {
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
});
alwaysProxy.addEventListener("change", (event) => {
browser.storage.sync.set({ alwaysProxy: event.target.checked });
});