Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
[Feature Request] Ability to control permission requests programmatically for StageWebView
Feature Description
AIR should have ability to control permission requests programmatically with StageWebView
for Windows.
Essential for modern WebView2 implementation with <UseWebView2>true</UseWebView2>
in application descriptor.
Right now it not possible programmatically to grant or deny permission request to use Camera/Microphone/... via website with StageWebView
. It could be done only manually by user.
In many cases it not acceptable. Especially for retail kiosks where is no user.
Related links: https://github.com/MicrosoftEdge/WebView2Feedback/issues/308#issuecomment-864734344 https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.permissionrequested?view=WebView2-dotnet-1.0.664.37 https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2permissionkind?view=webview2-dotnet-1.0.1054.31
I think it could be implemented with StageWebView
and PermissionEvent
. If AS3 code handle such PermissionEvent
for StageWebView
it should have a method to grant or deny permission request by code. If it doesn't handle - default permission prompt for user should be shown.
Useful functionality for other platforms too.
Related issue (not the same): https://github.com/airsdk/Adobe-Runtime-Support/issues/1492 https://github.com/airsdk/Adobe-Runtime-Support/issues/1493
Known Workarounds
none
Actually it necessary for other platforms too. For Android it could be implemented like described here (but we haven't access to WebView objects inside AIR): https://stackoverflow.com/questions/40659198/how-to-access-the-camera-from-within-a-webview
I am experiencing the same issue on Android when using JavaScript getUserMedia inside a StageWebView. It's really frustrating because I lost an important project due to this limitation. @ajwfrost Do you have any idea when this feature might be implemented?