diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index 5551bebd32..67a0887a20 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -260,6 +260,10 @@ class IframeBoss: self.content_loaded_stage2() def content_loaded_stage2(self): + # this is the loading styles used to suppress scrollbars during load + # added in unserialize_html + document.head.firstChild.textContent = '' + self.connect_links() self.content_ready = True csi = current_spine_item() diff --git a/src/pyj/read_book/resources.pyj b/src/pyj/read_book/resources.pyj index 05cdf617e0..37aa49699b 100644 --- a/src/pyj/read_book/resources.pyj +++ b/src/pyj/read_book/resources.pyj @@ -239,6 +239,7 @@ def unserialize_html(serialized_data, proceed, postprocess_dom): head, body = tree[1], tree[2] # noqa: unused-local clear(document.head, document.body) remove_all_attributes(document.head, document.body) + document.head.appendChild(E.style(type='text/css', 'html::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }')) # Default stylesheet if not runtime.is_standalone_viewer: # for the standalone viewer the default font family is set diff --git a/src/pyj/read_book/settings.pyj b/src/pyj/read_book/settings.pyj index 4d137b2dfe..01c840ce2f 100644 --- a/src/pyj/read_book/settings.pyj +++ b/src/pyj/read_book/settings.pyj @@ -45,7 +45,7 @@ def apply_colors(): else: text = '' - ss.textContent = text + '\n\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }' + ss.textContent = text def apply_stylesheet():