[Feature]: Allow fullscreen Cross-Origin element programmatically
Describe the feature/enhancement you need
Although browsers have security concerns about prohibiting full-screen elements without user gestures, programs with embedded WebView2 sometimes need to allow the user to click on an external button to go fullscreen on a Cross-Origin element.
Is it possible to make an element fullscreen via AdditionalBrowserArguments or CoreWebView2.PermissionRequested?
The scenario/use case where you would use this feature
Taking over the web player with WinUI3
How important is this request to you?
Impactful. My app's user experience would be significantly compromised without it.
Suggested implementation
Allow fullscreen an element via AdditionalBrowserArguments or CoreWebView2.PermissionRequested
What does your app do? Is there a pending deadline for this request?
No response
Add the moment I had to add a button in my dialog which causes the html to show a popup, maximized to the display.
javascript allow to activate the fullscreen for an element, even for the entire document. find the video element on the page and execute "element.requestFullscreen();"
javascript allow to activate the fullscreen for an element, even for the entire document. find the video element on the page and execute "element.requestFullscreen();"
@jls28 No. requestFullscreen is not allowed to be called from code, you can only use Playwright or perform manual operations.
Sorry, in my classic Win32 environment everything is nice. Javascript is available and fullscreen doesn't require any permission (like any normal browser).
Test page for requestFullscreen() : https://www.w3schools.com/jsref/api_fullscreen.asp
@jls28 I'm very sorry, I omitted a crucial condition: the video cannot be played in full screen when it's cross origin (embedded in an iframe).
Even after doing everything possible to remove all cross origin restrictions, it still doesn't work:
var opt = new CoreWebView2EnvironmentOptions
{
AdditionalBrowserArguments = "--disable-web-security --disable-site-isolation-trials --proxy-auto-detect"
};
Do you have any good solutions?