diff options
author | ame <[email protected]> | 2025-04-28 15:46:45 -0500 |
---|---|---|
committer | ame <[email protected]> | 2025-04-28 15:46:45 -0500 |
commit | 4d5fb9d8041eda3fd36b6f51af15bff059bdf1cf (patch) | |
tree | d963d3a3123b843fde62d19d9f4d32b49a5018db /background.js | |
parent | 3321f7444165e703447f1f7761e358d69a6d4436 (diff) |
Diffstat (limited to 'background.js')
-rw-r--r-- | background.js | 13 |
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; } |