From 48f4fd1aac5a8b36309342b24ec225f9d17ba132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Wed, 4 May 2022 00:06:05 +0200 Subject: [PATCH] improve website appearance patch --- .../ui-patches/hide-website-appearance.patch | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/patches/ui-patches/hide-website-appearance.patch b/patches/ui-patches/hide-website-appearance.patch index a451017..536c930 100644 --- a/patches/ui-patches/hide-website-appearance.patch +++ b/patches/ui-patches/hide-website-appearance.patch @@ -1,13 +1,35 @@ -diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml -index 11e2418..14aed40 100644 ---- a/browser/components/preferences/main.inc.xhtml -+++ b/browser/components/preferences/main.inc.xhtml -@@ -127,7 +127,7 @@ - +--- a/browser/components/preferences/main.js ++++ b/browser/components/preferences/main.js +@@ -806,6 +806,32 @@ var gMainPane = { + () => this.readBrowserContainersCheckbox() + ); + ++ if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) { ++ document.getElementById("web-appearance-chooser").style.opacity = 0.3; ++ document.getElementById("web-appearance-chooser").style.pointerEvents = "none"; ++ const infoBox = document.createElement("div"); ++ infoBox.classList.add("info-box-container"); ++ infoBox.style.display = "flex"; ++ infoBox.style.marginBottom = "10px"; ++ const icon = document.createElement("div"); ++ icon.classList.add("info-icon-container"); ++ infoBox.appendChild(icon); ++ const text = document.createElement("div"); ++ text.innerText = "Since RPF is enabled, the website appearance chooser is disabled."; ++ infoBox.appendChild(text); ++ const learnMore = document.createElement("a"); ++ learnMore.classList.add("text-link"); ++ learnMore.style.marginLeft = "5px"; ++ learnMore.setAttribute("is", "learn-more"); ++ learnMore.href = "https://librewolf.net/docs/faq/#why-is-librewolf-forcing-light-theme"; ++ learnMore.innerText = "Learn more"; ++ infoBox.appendChild(learnMore); ++ const manageThemes = document.getElementById("webAppearanceSettings").lastElementChild; ++ manageThemes.remove(); ++ document.getElementById("webAppearanceSettings").append(infoBox); ++ document.getElementById("webAppearanceSettings").appendChild(manageThemes); ++ } ++ + this.setInitialized(); + }, - --