0

I'm trying to make a wx.html2.WebView high enough that its contents don't need to be scrolled.

I tried using javascript in RunScript to detect that document height is larger than window height, but it won't work on some backends, for which RunScript does not return results.

Can I detect scrollbars on the WebView from Python to adapt the height ? Is there another way ?

Arnaud
  • 43
  • 3

1 Answers1

0

I found a hack that works : I inject javascript that on document load navigates to "size:"+document.body.scrollHeight

Then, I bind to the event EVT_WEBVIEW_NAVIGATING, veto it and use the URL from the event to get the height and set the WebView height to it.

Arnaud
  • 43
  • 3