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 /unhook.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 'unhook.js')
| -rw-r--r-- | unhook.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,6 @@ +// Chrome/Firefox compatibility +const browserAPI = globalThis.browser || globalThis.chrome; + // Single stylesheet for all hiding rules let styleElement = null; @@ -56,7 +59,8 @@ function applyStyles(settings) { } async function main() { - const settings = await browser.storage.local.get(null); + // Chrome/Firefox compatibility + const settings = await browserAPI.storage.local.get(null); applyStyles(settings); } @@ -64,7 +68,7 @@ async function main() { main(); // Listen for storage changes and reapply all settings -browser.storage.onChanged.addListener(() => { +browserAPI.storage.onChanged.addListener(() => { main(); }); |
