Page 1 of 1
document.body.requestFullscreen()
Posted: Fri Nov 11, 2022 8:04 am
by 312684696
document.body.requestFullscreen()
Run this function
then the document's scrollbar is hided and Invalid mouse scrolling
1.png
after call requestFullscreen()
2.png
Re: document.body.requestFullscreen()
Posted: Sat Nov 12, 2022 11:00 am
by salvadordf
Hi,
The embedded web browser decides when a scrollbar is needed.
Use the TWVBrowser.OnContainsFullScreenElementChanged event to detect when an HTML element inside the WebView requested the fullscreen mode :
https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.1418.22#add_containsfullscreenelementchanged
The TWVBrowser.ContainsFullScreenElement property indicates if the WebView contains a fullscreen HTML element.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.1418.22#get_containsfullscreenelement
Depending on the framework you use (FMX, VCL or LCL) you should set the TForm.FullScreen property accordingly, or resize the form and hide or show the window borders, caption and system buttons.