0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 13:43:04 -05:00
LibreWolf/patches/ui-patches/website-appearance-ui-rfp.patch

53 lines
2.6 KiB
Diff
Raw Permalink Normal View History

2022-05-03 17:06:05 -05:00
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
2023-11-25 09:52:33 -05:00
@@ -4184,6 +4184,7 @@ const AppearanceChooser = {
2022-12-03 09:15:22 -05:00
2022-05-12 15:32:55 -05:00
FORCED_COLORS_QUERY.addEventListener("change", this);
Services.prefs.addObserver(PREF_USE_SYSTEM_COLORS, this);
+ Services.prefs.addObserver("privacy.resistFingerprinting", this);
Services.obs.addObserver(this, "look-and-feel-changed");
this._update();
},
2023-11-25 09:52:33 -05:00
@@ -4203,6 +4204,7 @@ const AppearanceChooser = {
2022-05-03 17:06:05 -05:00
2022-05-12 15:32:55 -05:00
destroy() {
Services.prefs.removeObserver(PREF_USE_SYSTEM_COLORS, this);
+ Services.prefs.removeObserver("privacy.resistFingerprinting", this);
Services.obs.removeObserver(this, "look-and-feel-changed");
FORCED_COLORS_QUERY.removeEventListener("change", this);
2022-12-03 09:15:22 -05:00
},
2023-11-25 09:52:33 -05:00
@@ -4242,5 +4244,33 @@ const AppearanceChooser = {
2022-05-12 15:32:55 -05:00
(AppConstants.platform == "win" ||
!Services.prefs.getBoolPref(PREF_USE_SYSTEM_COLORS));
this.warning.hidden = !forcingColorsAndNoColorSchemeSupport;
+
2023-11-25 09:52:33 -05:00
+ document.getElementById("web-appearance-rfp-warning")?.remove();
2022-05-03 17:06:05 -05:00
+ 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");
2022-05-12 15:32:55 -05:00
+ infoBox.id = "web-appearance-rfp-warning";
2022-05-03 17:06:05 -05:00
+ infoBox.classList.add("info-box-container");
+ infoBox.style.display = "flex";
2022-05-03 17:49:57 -05:00
+ infoBox.style.alignItems = "center";
+ infoBox.style.marginTop = "10px";
+ infoBox.style.marginBottom = "5px";
2022-05-03 17:06:05 -05:00
+ const text = document.createElement("div");
2022-05-03 17:49:57 -05:00
+ text.innerText = "This feature is disabled because ResistFingerprinting is enabled. This means LibreWolf will force web content to display in a light theme.";
2022-05-03 17:06:05 -05:00
+ infoBox.appendChild(text);
+ const learnMore = document.createElement("a");
+ learnMore.classList.add("text-link");
+ learnMore.style.marginLeft = "5px";
2022-05-03 17:49:57 -05:00
+ learnMore.style.flexShrink = 0;
2022-05-03 17:06:05 -05:00
+ 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);
2022-05-03 17:49:57 -05:00
+ document.getElementById("webAppearanceSettings").insertBefore(infoBox, document.getElementById("webAppearanceSettings").children[2]);
2022-05-12 15:32:55 -05:00
+ } else {
+ document.getElementById("web-appearance-chooser").style.opacity = 1;
+ document.getElementById("web-appearance-chooser").style.pointerEvents = "all";
2022-05-03 17:06:05 -05:00
+ }
},
2022-05-12 15:32:55 -05:00
};