summaryrefslogtreecommitdiff
path: root/background.js
diff options
context:
space:
mode:
authorame <[email protected]>2025-04-28 15:46:45 -0500
committerame <[email protected]>2025-04-28 15:46:45 -0500
commit4d5fb9d8041eda3fd36b6f51af15bff059bdf1cf (patch)
treed963d3a3123b843fde62d19d9f4d32b49a5018db /background.js
parent3321f7444165e703447f1f7761e358d69a6d4436 (diff)
add whitelist/blacklist for all stylingHEADmaster
Diffstat (limited to 'background.js')
-rw-r--r--background.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/background.js b/background.js
index bc30678..99948ab 100644
--- a/background.js
+++ b/background.js
@@ -1,4 +1,5 @@
let SKIP_FORCE_THEMING_KEY = "skipForceThemingList";
+let SKIP_THEMING_KEY = "skipThemingList";
let logging = true; // Enable logging for debugging
// Create a cache for pre-processed CSS to speed up repeated visits
@@ -231,8 +232,16 @@ async function applyCSSToTab(tab) {
const globalSettings = settings.transparentZenSettings || {};
console.log("DEBUG: Global settings:", JSON.stringify(globalSettings));
- if (globalSettings.enableStyling === false) {
- console.log("DEBUG: Styling is globally disabled, exiting early");
+ const skipStyleListData = await browser.storage.local.get(
+ SKIP_THEMING_KEY
+ );
+ const skipStyleList = skipStyleListData[SKIP_THEMING_KEY] || [];
+ const styleMode = globalSettings.whitelistStyleMode ?? true;
+
+ if (globalSettings.enableStyling === false ||
+ !styleMode && skipStyleList.includes(hostname) ||
+ styleMode && !skipStyleList.includes(hostname)) {
+ console.log("DEBUG: Styling is disabled, exiting early");
return;
}