document.body.requestFullscreen()

Post Reply
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

document.body.requestFullscreen()

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4125
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: document.body.requestFullscreen()

Post 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.
Post Reply