-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File System Access API prompts do not call PermissionRequested event #1039
Comments
Thanks for the report @AshleyScirra - I've added this bug to our backlog to take a look. |
Do you have any Idea when this Bug will be resolved? |
Hi @AshleyScirra and @groege, we added support for this permission kind in our latest prerelease package, 1.0.1619-prerelease. The PermissionRequested event will now be raised for requests of the kind COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE. Steps for testing upcoming APIs/ features: Permission management spec: https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/specs/PermissionManagement.md |
That's great to see, thanks! |
@AshleyScirra @groege this permission kind is now part of the latest release package, 1.0.1661.34. Closing this issue as completed but feel free to reactivate if you run into any problems. :) |
Description
The File System Access API (formerly the Native File System API) allows access to local files. It sometimes shows permission prompts for file access, such as "Save changes to test.txt?" with options "Save changes" and "Cancel". These prompts do not go through the PermissionRequested event in WebView2, so they cannot be controlled. In particular if the WebView2 is showing local app-provided content, there's no point having these prompts since the containing app already has access to the file system, but the prompts cannot be removed.
Version
SDK: 1.0.705.50
Runtime: Stable 89.0.774.45
Framework: Win32
OS: Win10 x64 20H2
Repro Steps
I just took the getting started guide: https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/win32
And set the navigation URL to this repro page:https://downloads.scirra.com/labs/bugs/fileaccessprompt/index.html
Before the
Navigate
call, I inserted the following code snippet that logs if the PermissionRequested event happens, and approves all requests:Run the app, click 'Pick file', and choose a file. (Nothing is written to this file, it only uses
fileHandle.requestPermission()
to request write permission, then stops.)In both the browser and WebView2, it shows a "Save changes?" permission prompt. In WebView2, the PermissionRequested event does not appear to run (nothing is written to debug output). It should run this event and take in to account the indicated state (i.e. automatically allow).
AB#32079502
The text was updated successfully, but these errors were encountered: