From e868bfeca5501c7c02f1fc1013ea6cc7e79af043 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 14 Jul 2023 00:31:10 +0200 Subject: firefox: Make FOUC less annoying Flash of unstyled content[1] is a common issue in browsers and happens whenever transitioning to a page without the full styles being loaded. For the most part, Firefox does a good job preventing FOUC, but in some occasions the default colors still show up. Since I do prefer a dark color scheme anyway, let's actually make sure that the default colors represent a dark color scheme. The reason why I picked the dark colors from startpage.com is purely because it was the next best to pick some colors from, rather than personal preference. [1]: https://en.wikipedia.org/wiki/Flash_of_unstyled_content Signed-off-by: aszlig --- pkgs/aszlig/firefox/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkgs') diff --git a/pkgs/aszlig/firefox/default.nix b/pkgs/aszlig/firefox/default.nix index 1c49fc6a..3ae44e4a 100644 --- a/pkgs/aszlig/firefox/default.nix +++ b/pkgs/aszlig/firefox/default.nix @@ -77,6 +77,13 @@ in wrapFirefox firefoxNoSigning { lockPref('privacy.trackingprotection.socialtracking.enabled', true); lockPref('reader.color_scheme', 'dark'); + // Make flash of unstyled content less annoying by defaulting to + // Startpage's dark color scheme. + lockPref('browser.display.background_color', '#171B25'); + lockPref('browser.display.foreground_color', '#EBECF7'); + lockPref('browser.anchor_color', '#A7B1FC'); + lockPref('browser.visited_color', '#AD71BC'); + pref('browser.uiCustomization.state', ${jsString (builtins.toJSON { placements = { widget-overflow-fixed-list = []; -- cgit 1.4.1