From deb071d55629406ed42c1eb877f69092ca10efc9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 5 Feb 2021 18:31:13 -0500 Subject: [PATCH] qutebrowser: mitigate flash of white between page loads --- .../greasemonkey/let-there-be-light.user.js | 12 ++++++++++++ modules/themes/alucard/config/qutebrowser/theme.py | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 config/qutebrowser/greasemonkey/let-there-be-light.user.js diff --git a/config/qutebrowser/greasemonkey/let-there-be-light.user.js b/config/qutebrowser/greasemonkey/let-there-be-light.user.js new file mode 100644 index 00000000..09de60e8 --- /dev/null +++ b/config/qutebrowser/greasemonkey/let-there-be-light.user.js @@ -0,0 +1,12 @@ +// ==UserScript== +// @name Let there be Light +// @description Change page background to white. +// @version 0.1 +// @author Ingvix +// @include * +// ==/UserScript== + +// Needed to counterbalance my colors.webpage.bg hack to prevent the blinding +// flash of white between page loads. +var sheet = window.document.styleSheets[0]; +sheet.insertRule('body { background-color: white; }', sheet.cssRules.length); diff --git a/modules/themes/alucard/config/qutebrowser/theme.py b/modules/themes/alucard/config/qutebrowser/theme.py index b33256d1..1334fb1c 100644 --- a/modules/themes/alucard/config/qutebrowser/theme.py +++ b/modules/themes/alucard/config/qutebrowser/theme.py @@ -31,6 +31,11 @@ padding = { 'left': spacing['horizontal'] } +# HACK This is set to mitigate the blinding flash of white in between page +# loads. This can break sites with no explicit background, so I rely on the +# let-there-be-light.user.js greasemonkey script to "reset" the background. +c.colors.webpage.bg = palette['background'] + ## UI # Scrollbar style; much less intrusive than the default c.scrolling.bar = "overlay"