-
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 Access API without security prompts #3121
Comments
Hi @CoenraadS, you can handle the PermissionRequested event and allow requests of this kind: COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE. Alternatively, if you would like to allow permission for a particular origin, you can try the experimental SetPermissionState API. |
Thanks for the response, but
Does not trigger, at least not with the following html:
|
Oh sorry - we recently added this permission kind to the prerelease SDK, 1.0.1619-prerelease. You can try it now with a preview channel and we will update you when it becomes available in release. :) |
@CoenraadS this permission kind is now part of the latest release package, 1.0.1661.34. You should now be able to use the PermissionRequested event to handle requests of the kind FileReadWrite. The SetPermissionStateAsync API is also available if you would like to set the permission per origin. Thanks! |
Is your feature request related to a problem? Please describe.
The user interacts with a webpage that uses
window.showDirectoryPicker
After selecting the folder they want, this popup appears:
The user then clicks ok, and now the browser has access to this folder
The user then restarts the app
The browser has lost access to the folder (storing the handle doesn't work, permissions are revoked)
The user again has to select the folder, and again the security prompt
Describe the solution you'd like and alternatives you've considered
Some flag I can pass to webview2 such as
--disable-file-access-security
to disable these popups (automatically accept)It should also allow a file/directory handle to be reused across app restarts.
Point 1 is most important, point 2 is nice to have
The text was updated successfully, but these errors were encountered: