Update popup.js
This commit is contained in:
parent
612d359279
commit
1d4c61f4af
|
@ -5,6 +5,7 @@ let disableInvidious = document.querySelector("#disable-invidious");
|
||||||
let disableBibliogram = document.querySelector("#disable-bibliogram");
|
let disableBibliogram = document.querySelector("#disable-bibliogram");
|
||||||
let disableOsm = document.querySelector("#disable-osm");
|
let disableOsm = document.querySelector("#disable-osm");
|
||||||
let disableOldReddit = document.querySelector("#disable-old-reddit");
|
let disableOldReddit = document.querySelector("#disable-old-reddit");
|
||||||
|
let disableSearchEngine = document.querySelector("#disable-searchEngine");
|
||||||
let version = document.querySelector("#version");
|
let version = document.querySelector("#version");
|
||||||
|
|
||||||
window.browser = window.browser || window.chrome;
|
window.browser = window.browser || window.chrome;
|
||||||
|
@ -16,6 +17,7 @@ browser.storage.sync.get(
|
||||||
"disableBibliogram",
|
"disableBibliogram",
|
||||||
"disableOsm",
|
"disableOsm",
|
||||||
"disableOldReddit",
|
"disableOldReddit",
|
||||||
|
"disableSearchEngine",
|
||||||
"theme",
|
"theme",
|
||||||
],
|
],
|
||||||
(result) => {
|
(result) => {
|
||||||
|
@ -25,6 +27,7 @@ browser.storage.sync.get(
|
||||||
disableBibliogram.checked = !result.disableBibliogram;
|
disableBibliogram.checked = !result.disableBibliogram;
|
||||||
disableOsm.checked = !result.disableOsm;
|
disableOsm.checked = !result.disableOsm;
|
||||||
disableOldReddit.checked = !result.disableOldReddit;
|
disableOldReddit.checked = !result.disableOldReddit;
|
||||||
|
disableSearchEngine.checked = !result.disableSearchEngine;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -50,6 +53,10 @@ disableOldReddit.addEventListener("change", (event) => {
|
||||||
browser.storage.sync.set({ disableOldReddit: !event.target.checked });
|
browser.storage.sync.set({ disableOldReddit: !event.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
disableSearchEngine.addEventListener("change", (event) => {
|
||||||
|
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
|
||||||
|
});
|
||||||
|
|
||||||
document.querySelector("#more-options").addEventListener("click", () => {
|
document.querySelector("#more-options").addEventListener("click", () => {
|
||||||
browser.runtime.openOptionsPage();
|
browser.runtime.openOptionsPage();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue