aboutsummaryrefslogtreecommitdiff
path: root/unhook.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 /unhook.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 'unhook.js')
-rw-r--r--unhook.js8
1 files changed, 6 insertions, 2 deletions
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();
});