diff options
author | sameerasw <[email protected]> | 2025-05-09 01:35:35 +0530 |
---|---|---|
committer | sameerasw <[email protected]> | 2025-05-09 01:35:35 +0530 |
commit | 3badfce6d20405153864180deaa86136014b2cba (patch) | |
tree | b0deeab10a5da50d24b4ba987be27ef43991a7d3 /background.js | |
parent | 29a6a8b340e27024ba27c2ff42e4bb35599ee33e (diff) |
added global hover and footer options
Diffstat (limited to 'background.js')
-rw-r--r-- | background.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/background.js b/background.js index 19ef0fe..179fc23 100644 --- a/background.js +++ b/background.js @@ -27,6 +27,8 @@ const DEFAULT_SETTINGS = { whitelistMode: false, // Use blacklist mode by default for force styling whitelistStyleMode: false, // Use blacklist mode by default for regular styling disableTransparency: false, // Don't disable transparency by default + disableHover: false, // Don't disable hover effects by default + disableFooter: false, // Don't disable footers by default }; // Helper function to normalize hostnames by removing www. prefix @@ -716,12 +718,17 @@ async function applyCSS(tabId, hostname, features) { let combinedCSS = ""; let includedFeatures = 0; let skippedTransparencyFeatures = 0; + let skippedHoverFeatures = 0; + let skippedFooterFeatures = 0; let skippedDisabledFeatures = 0; for (const [feature, css] of Object.entries(features)) { const isTransparencyFeature = feature .toLowerCase() .includes("transparency"); + const isHoverFeature = feature.toLowerCase().includes("hover"); + const isFooterFeature = feature.toLowerCase().includes("footer"); + // Skip any transparency feature if disableTransparency is enabled globally if (globalSettings.disableTransparency && isTransparencyFeature) { console.log(`DEBUG: Skipping transparency feature: ${feature}`); @@ -729,6 +736,20 @@ async function applyCSS(tabId, hostname, features) { continue; } + // Skip any hover feature if disableHover is enabled globally + if (globalSettings.disableHover && isHoverFeature) { + console.log(`DEBUG: Skipping hover feature: ${feature}`); + skippedHoverFeatures++; + continue; + } + + // Skip any footer feature if disableFooter is enabled globally + if (globalSettings.disableFooter && isFooterFeature) { + console.log(`DEBUG: Skipping footer feature: ${feature}`); + skippedFooterFeatures++; + continue; + } + const isFeatureEnabled = featureSettings[feature] !== false; if (isFeatureEnabled) { combinedCSS += css + "\n"; @@ -741,7 +762,7 @@ async function applyCSS(tabId, hostname, features) { } console.log( - `DEBUG: CSS Summary - included: ${includedFeatures}, skipped transparency: ${skippedTransparencyFeatures}, skipped disabled: ${skippedDisabledFeatures}` + `DEBUG: CSS Summary - included: ${includedFeatures}, skipped transparency: ${skippedTransparencyFeatures}, skipped hover: ${skippedHoverFeatures}, skipped footer: ${skippedFooterFeatures}, skipped disabled: ${skippedDisabledFeatures}` ); if (combinedCSS) { |