From d3c0452d6fac3e9a49a28f44634a30b91a9d9d2d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Oct 2019 20:20:57 +0530 Subject: [PATCH] Viewer: Hide the browser provided scrollbar that flashes momentarily on page load. Fixes #1846922 [Scroll bar in new viewer](https://bugs.launchpad.net/calibre/+bug/1846922) --- src/pyj/read_book/settings.pyj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/settings.pyj b/src/pyj/read_book/settings.pyj index 2e925bf732..512e8a16ac 100644 --- a/src/pyj/read_book/settings.pyj +++ b/src/pyj/read_book/settings.pyj @@ -41,9 +41,11 @@ def apply_colors(): document.documentElement.appendChild(ss) if opts.color_scheme.link: c = opts.color_scheme.link - ss.textContent = f':link, :link * {{ color: {c} !important }} :visited, :visited * {{ color: {c} !important }}' + text = f':link, :link * {{ color: {c} !important }} :visited, :visited * {{ color: {c} !important }}' else: - ss.textContent = '' + text = '' + + ss.textContent = text + '\n\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none }' def apply_stylesheet():