Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

[Feature Request] Ability to control permission requests programmatically for StageWebView

Open itlancer opened this issue 3 years ago • 2 comments

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

itlancer avatar Dec 24 '21 16:12 itlancer

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

itlancer avatar Oct 05 '22 07:10 itlancer

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?

marcanw avatar Jun 15 '24 14:06 marcanw