Page 1 of 1

Re: Hide Scrollbars in TChromium

Posted: Fri Nov 16, 2018 3:22 pm
by salvadordf
Hi,

As far as I know, there's no browser setting to hide the scrollbars.

However, you should be able to use JavaScript. Use this code in the TChromium.OnLoadEnd event :

Code: Select all

if frame.isMain then
  frame.ExecuteJavaScript('document.body.style.overflow = ' + quotedstr('hidden') + ';', 'about:blank', 0);

Re: Hide Scrollbars in TChromium

Posted: Sat Nov 17, 2018 8:12 am
by salvadordf
Biernemaya wrote: Fri Nov 16, 2018 11:50 pmI tried your code ... but the problem is that the mouse-wheel is not working anymore and the scrollbars appear shortly.
Do you have an idea how i can do it without loosing mouse-wheel-functionality?
Try modifying the style sheets with JavaScript as described here :
https://www.w3.org/wiki/Dynamic_style_- ... JavaScript
https://davidwalsh.name/add-rules-stylesheets

There are many more CSS and JavaScript tricks to modify the scrollbars. Search for "javascript hide scrollbar" in google and try them in the MiniBrowser demo following these steps :
  • Run the MiniBrowser demo.
  • Load a web page.
  • Click the upper-right button with 3 lines.
  • Open the development tools.
  • Select the "Console" tab.
  • Type the JavaScript code you want to try.
  • Press ENTER to execute it.
Biernemaya wrote: Fri Nov 16, 2018 11:50 pmIs there a way to change the html-code before the page is displayed?
You can also inject inline CSS by using the ResponseFilterBrowser demo. It's a much more complicated way to get the same results but you will not see any scrollbars.
However, it only works if the HTML is not available in the browser cache. If you decide to use this, you will have to add some HTTP headers to download the resources ignoring the cache.