From 78271568ac082ffab8239cf5c0ff06590e13d85d Mon Sep 17 00:00:00 2001 From: Alexander Li Date: Mon, 26 Jan 2026 18:48:53 -0500 Subject: Update manifest to version 3 and improve popup checkbox functionality (#1) Update manifest to version 3 and improve popup checkbox functionality --- unhook.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'unhook.js') diff --git a/unhook.js b/unhook.js index 4e2066a..1eb60df 100644 --- a/unhook.js +++ b/unhook.js @@ -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(); }); -- cgit v1.3.1