0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 21:53:31 -05:00

update website appearance patch

This commit is contained in:
Malte Jürgens 2022-05-12 22:32:55 +02:00
parent b5f33aba91
commit 123e41ac67
No known key found for this signature in database
GPG key ID: D29FBD5F93C0CFC3

View file

@ -1,13 +1,31 @@
--- a/browser/components/preferences/main.js --- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js +++ b/browser/components/preferences/main.js
@@ -806,6 +806,29 @@ var gMainPane = { @@ -3737,6 +3737,7 @@ const AppearanceChooser = {
() => this.readBrowserContainersCheckbox() FORCED_COLORS_QUERY.addEventListener("change", this);
); SYSTEM_DARK_MODE_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();
},
@@ -3756,6 +3757,7 @@ const AppearanceChooser = {
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);
SYSTEM_DARK_MODE_QUERY.removeEventListener("change", this);
@@ -3798,5 +3800,33 @@ const AppearanceChooser = {
(AppConstants.platform == "win" ||
!Services.prefs.getBoolPref(PREF_USE_SYSTEM_COLORS));
this.warning.hidden = !forcingColorsAndNoColorSchemeSupport;
+
+ if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) { + if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) {
+ document.getElementById("web-appearance-chooser").style.opacity = 0.3; + document.getElementById("web-appearance-chooser").style.opacity = 0.3;
+ document.getElementById("web-appearance-chooser").style.pointerEvents = "none"; + document.getElementById("web-appearance-chooser").style.pointerEvents = "none";
+ const infoBox = document.createElement("div"); + const infoBox = document.createElement("div");
+ infoBox.id = "web-appearance-rfp-warning";
+ infoBox.classList.add("info-box-container"); + infoBox.classList.add("info-box-container");
+ infoBox.style.display = "flex"; + infoBox.style.display = "flex";
+ infoBox.style.alignItems = "center"; + infoBox.style.alignItems = "center";
@ -25,8 +43,10 @@
+ learnMore.innerText = "Learn more"; + learnMore.innerText = "Learn more";
+ infoBox.appendChild(learnMore); + infoBox.appendChild(learnMore);
+ document.getElementById("webAppearanceSettings").insertBefore(infoBox, document.getElementById("webAppearanceSettings").children[2]); + document.getElementById("webAppearanceSettings").insertBefore(infoBox, document.getElementById("webAppearanceSettings").children[2]);
+ } else {
+ document.getElementById("web-appearance-rfp-warning")?.remove();
+ document.getElementById("web-appearance-chooser").style.opacity = 1;
+ document.getElementById("web-appearance-chooser").style.pointerEvents = "all";
+ } + }
+
this.setInitialized();
}, },
};