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); } });