firefox: legacyUserProfileCustomizations when userChrome is present

When a user configures the userChrome option, automatically enable the
`toolkit.legacyUserProfileCustomizations.stylesheets` preference with
`mkDefault` priority so that the user chrome CSS is actually loaded.
The user can still override this in the settings option if needed.
This commit is contained in:
Dionisie Stratulat 2026-06-25 22:15:06 +03:00 committed by GitHub
parent 3a70e333f2
commit 3b3ff17621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -20,6 +20,7 @@ let
length
literalExpression
mapAttrsToList
mkDefault
mkIf
mkMerge
mkOption
@ -884,6 +885,10 @@ in
};
config = {
settings = mkIf (config.userChrome != "") {
"toolkit.legacyUserProfileCustomizations.stylesheets" = mkDefault true;
};
assertions = [
(mkNoDuplicateAssertion config.containers "container")
{

View file

@ -31,6 +31,11 @@ in
id = 4;
userChrome = pkgs.writeText "userChrome.css" (builtins.readFile ./chrome/userChrome.css);
};
legacyUserPrCuSt-Disabled = {
id = 5;
userChrome = pkgs.writeText "userChrome.css" (builtins.readFile ./chrome/userChrome.css);
settings."toolkit.legacyUserProfileCustomizations.stylesheets" = false;
};
};
}
// {
@ -62,6 +67,14 @@ in
assertFileContent \
"home-files/${cfg.profilesPath}/derivation-file/chrome/userChrome.css" \
${./chrome/userChrome.css}
assertFileContains \
"home-files/${cfg.profilesPath}/lines/user.js" \
'user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);'
assertFileContains \
"home-files/${cfg.profilesPath}/legacyUserPrCuSt-Disabled/user.js" \
'user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);'
'';
}
);