aboutsummaryrefslogtreecommitdiff
path: root/popup.js
diff options
context:
space:
mode:
authorAlexander Li <github@thearchons.xyz>2026-01-26 18:48:53 -0500
committerGitHub <noreply@github.com>2026-01-26 18:48:53 -0500
commit78271568ac082ffab8239cf5c0ff06590e13d85d (patch)
treef6bbf7a3414e9a84705bcb14ce918d9cd57736a2 /popup.js
parenta4548634f185bbaa277d781f8c7cc664d10f0b28 (diff)
Update manifest to version 3 and improve popup checkbox functionality (#1)
Update manifest to version 3 and improve popup checkbox functionality
Diffstat (limited to 'popup.js')
-rw-r--r--popup.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/popup.js b/popup.js
index fd60ad0..756d1a0 100644
--- a/popup.js
+++ b/popup.js
@@ -1,3 +1,5 @@
+const browserAPI = globalThis.browser || globalThis.chrome;
+
const toggles = [
'hideHomeFeed',
'redirectToSubscriptions',
@@ -24,11 +26,11 @@ const toggles = [
];
// Load saved settings
-browser.storage.local.get(toggles).then((result) => {
+browserAPI.storage.local.get(toggles).then((result) => {
toggles.forEach((id) => {
const checkbox = document.getElementById(id);
if (checkbox) {
- checkbox.checked = result[id] !== false;
+ checkbox.checked = result[id] === true;
}
});
});
@@ -41,5 +43,5 @@ document.addEventListener('change', (e) => {
const checked = e.target.checked;
const settings = { [id]: checked };
- browser.storage.local.set(settings);
+ browserAPI.storage.local.set(settings);
});