diff options
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; } |