From 4b65c4b4f9837253a772bd4e612166631552080c Mon Sep 17 00:00:00 2001 From: Brandon T Date: Wed, 29 Nov 2023 16:01:58 -0500 Subject: [PATCH] Fix image inversion. --- .../Sandboxed/MainFrame/AtDocumentStart/NightModeScript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Brave/Frontend/UserContent/UserScripts/Sandboxed/MainFrame/AtDocumentStart/NightModeScript.js b/Sources/Brave/Frontend/UserContent/UserScripts/Sandboxed/MainFrame/AtDocumentStart/NightModeScript.js index 2eeaeec4b00..cc9b6da0eb3 100644 --- a/Sources/Brave/Frontend/UserContent/UserScripts/Sandboxed/MainFrame/AtDocumentStart/NightModeScript.js +++ b/Sources/Brave/Frontend/UserContent/UserScripts/Sandboxed/MainFrame/AtDocumentStart/NightModeScript.js @@ -50,8 +50,8 @@ function getStyleElement() { } function applyInvertFilterToChildBackgroundImageElements(parentNode) { - parentNode.querySelectorAll("[style*=\"background\"]").forEach(function(el) { - if ((el.style.backgroundImage || "").startsWith("url")) { + [...parentNode.children].forEach(function(el) { + if ((getComputedStyle(el)["background-image"] || "").startsWith("url")) { applyInvertFilterToElement(el); } });