diff --git a/background.js b/background.js index 7440e52..4d86418 100644 --- a/background.js +++ b/background.js @@ -1239,7 +1239,7 @@ class uDarkC extends uDarkExtended { if (!possiblecolor || possiblecolor === "none") { // none is not a color, and it not usefull to create a style element for it return false } - if (uDark.website_context && possiblecolor.includes("var(")) { + if (!uDark.is_background && possiblecolor.includes("var(")) { return uDark.is_color_var(possiblecolor, as_float, fill, cssRule, spanp) } diff --git a/backgroundClass.js b/backgroundClass.js index 20eee87..0fd68e6 100644 --- a/backgroundClass.js +++ b/backgroundClass.js @@ -381,7 +381,7 @@ class uDarkExtended extends uDarkExtendedContentScript { }), } regiteredCS = [] - is_background = true + is_background = true // Tell ultimadark that we are in the background script and is_color_var is not available for instance loggingWorkersActiveLogging = false // Conider moving this to imageWorker to avoid messages passing for nothing LoggingWorker = class LoggingWorker extends Worker { constructor(...args) { diff --git a/contentScriptClass.js b/contentScriptClass.js index a7926a1..e420243 100644 --- a/contentScriptClass.js +++ b/contentScriptClass.js @@ -1,7 +1,7 @@ class uDarkExtendedContentScript { is_content_script = true - website_context = true + website_context = true // Tell ultimadark we are in a website context and is_color_var is available install() { uDark.exportFunction = globalThis.exportFunction; // Don't override the exportFunction function, but make it available to ultimadark console.info("UltimaDark", "Content script install", window); @@ -83,7 +83,7 @@ class uDarkExtendedContentScript { let start = performance.now(); uDark.info( "Content script override website", window); - uDark.website_context = true; + uDark.website_context = true; // Tell ultimadark we are in a website context and is_color_var is available window.userSettingsReadyAction = function() { uDark.success("User settings ready", window.userSettings); if (!uDark.userSettings.keep_service_workers && window.navigator.serviceWorker) {