Package Details: librewolf-allow-dark 135.0-1

Git Clone URL: https://aur.archlinux.org/librewolf-allow-dark.git (read-only, click to copy)
Package Base: librewolf-allow-dark
Description: Librewolf with the privacy.override_rfp_for_color_scheme about:config option added, which (if enabled) let's you change the color scheme even if rfp is turned on
Upstream URL: https://librewolf.net/
Licenses: GPL, MPL, LGPL
Conflicts: librewolf
Provides: librewolf
Submitter: Mecso
Maintainer: Mecso
Last Packager: Mecso
Votes: 4
Popularity: 1.03
First Submitted: 2024-08-11 01:56 (UTC)
Last Updated: 2025-02-17 16:49 (UTC)

Required by (26)

Sources (4)

Latest Comments

karolyi commented on 2025-02-17 18:39 (UTC)

diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
index 8227fe6..ece4236 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -4284,6 +4284,7 @@ const AppearanceChooser = {
     FORCED_COLORS_QUERY.addEventListener("change", this);
     Services.prefs.addObserver(PREF_USE_SYSTEM_COLORS, this);
     Services.prefs.addObserver("privacy.resistFingerprinting", this);
+    Services.prefs.addObserver("privacy.override_rfp_for_color_scheme", this);
     Services.obs.addObserver(this, "look-and-feel-changed");
     this._update();
   },
@@ -4321,6 +4322,7 @@ const AppearanceChooser = {
   destroy() {
     Services.prefs.removeObserver(PREF_USE_SYSTEM_COLORS, this);
     Services.prefs.removeObserver("privacy.resistFingerprinting", this);
+    Services.prefs.removeObserver("privacy.override_rfp_for_color_scheme", this);
     Services.obs.removeObserver(this, "look-and-feel-changed");
     FORCED_COLORS_QUERY.removeEventListener("change", this);
   },
@@ -4362,7 +4364,8 @@ const AppearanceChooser = {
     this.warning.hidden = !forcingColorsAndNoColorSchemeSupport;

     document.getElementById("web-appearance-rfp-warning")?.remove();
-    if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) {
+    if (Services.prefs.getBoolPref("privacy.resistFingerprinting") &&
+      !Services.prefs.getBoolPref("privacy.override_rfp_for_color_scheme")) {
       document.getElementById("web-appearance-chooser").style.opacity = 0.3;
       document.getElementById("web-appearance-chooser").style.pointerEvents = "none";
       const infoBox = document.createElement("div");
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
index 46de702..e5e664f 100644
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -19567,7 +19567,8 @@ ColorScheme Document::DefaultColorScheme() const {

 ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const {
   if (ShouldResistFingerprinting(RFPTarget::CSSPrefersColorScheme) &&
-      aIgnoreRFP == IgnoreRFP::No) {
+      aIgnoreRFP == IgnoreRFP::No &&
+      !StaticPrefs::privacy_override_rfp_for_color_scheme()) {
     return ColorScheme::Light;
   }

diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
index 7364514..a5b603c 100644
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -15049,6 +15049,12 @@
   value: false
   mirror: always

+# Allows overriding RFP for only the dark/light pref
+- name: privacy.override_rfp_for_color_scheme
+  type: bool
+  value: false
+  mirror: always
+
 # Enforce tracking protection in all modes.
 - name: privacy.trackingprotection.enabled
   type: bool

karolyi commented on 2025-02-17 18:39 (UTC)

Wow, I thought you're not communicative at all. :) So I kept using my patchset.

Yes it does speed things up, in my experience. sccache has a ~5% cache hit rate when compiling with it, still seems to be more easy on the CPU. Also, it seems to hit compilations between source version changes, as not a lot of changes there between versions — as compared to the entire codebase.

Anyways, I'm thinking on creating the -bin version of this repo, so I could use my own compiled librewolf on my other PC as well. And it seems that I manage to compile it pretty timely manner upon update, since I am a dev for various websites and librewolf is also my chosen tool for working.

Nice touch with reenabling the chooser in preferences! Just tested the compiled version, there was a typo-like thing you did there, attached my patch for review. I'm thinking on making the override_rfp_for_color_scheme option changeable with a Services.prefs.setBoolPref() call sometime, by adding an option to the librewolf settings section. Then the whole thing could become a bit more official. I'm just not on the same page with librewolf patchers' opinion on disabling it forcingly, they still didn't manage to provide good evidence on how this breaks entropy, to this day.

Feel free to use this change — or not. :) I'm already using it since a long time.

Mecso commented on 2025-02-17 16:31 (UTC)

@karolyi the main.js modification makes it so that the the theme option in the settings is not grayed out

Mecso commented on 2025-02-17 16:25 (UTC)

@karolyi, would that actually do something? As far as I understand this would only help with incremental/interrupted compilation, but makepkg always deletes everything and starts from scratch. The docs even say that it will make the initial compilation (the only compilation that's happening) slower since it requires additional book keeping https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#sccache.

karolyi commented on 2024-08-25 12:42 (UTC) (edited on 2024-08-25 12:43 (UTC) by karolyi)

Please add this to PKGBUILD, speeds up the compilation (especially the second phase) immensely:

@@ -116,6 +116,9 @@ prepare() {
 # TODO: check things here one after another if (still) required
 ac_add_options --enable-linker=lld

+# See https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#sccache
+ac_add_options --with-ccache=sccache
+
 ac_add_options --prefix=/usr

karolyi commented on 2024-08-15 10:24 (UTC)

Hey,

you're my man with this package! I've tried to get this patch back into librewolf originally when it disappeared, but I've faced such a backlash I've given up on it an kept the patchset for myself:

https://codeberg.org/librewolf/issues/issues/1281

I now compile my browser with that patchset every time a new version arrives.

Looking into the patch itself, it's pretty similar to what I have. I don't have the changes in main.js though. Can you please enlighten me what that's about?

Also I'm looking into getting this automatically compiled on some virtual machine but right now I couldn't find a viable solution where a VM is offered for a short while, until the compilation is done and the binaries are copied away.

Any ideas on that?