diff options
| author | Alexander Li <github@thearchons.xyz> | 2026-01-26 18:48:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 18:48:53 -0500 |
| commit | 78271568ac082ffab8239cf5c0ff06590e13d85d (patch) | |
| tree | f6bbf7a3414e9a84705bcb14ce918d9cd57736a2 /popup.js | |
| parent | a4548634f185bbaa277d781f8c7cc664d10f0b28 (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.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); }); |
