summaryrefslogtreecommitdiff
path: root/background.js
diff options
context:
space:
mode:
authorSameera Sandakelum <[email protected]>2025-04-29 03:52:11 +0530
committerGitHub <[email protected]>2025-04-29 03:52:11 +0530
commit1ede58e69461bd4b4be80b1ca5d35297b940927b (patch)
treed963d3a3123b843fde62d19d9f4d32b49a5018db /background.js
parent3321f7444165e703447f1f7761e358d69a6d4436 (diff)
parent4d5fb9d8041eda3fd36b6f51af15bff059bdf1cf (diff)
Merge pull request #11 from ameliasquires/master
add whitelist/blacklist for all styling This is nice, previously we had to turn each feature off to skip a website. There are some needed changes further but I will add them soon.
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;
}