Skip to content
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

[Enhancement]: Missing support for Persistent Permissions with the File System Access API as of Chrome 122 #41957

Open
3 tasks done
Jaifroid opened this issue Apr 24, 2024 · 0 comments

Comments

@Jaifroid
Copy link

Preflight Checklist

Electron Version

30.0.0

What operating system are you using?

Windows

Operating System Version

Windows 11 (fully updated)

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Chrome 122+ now has persistent permissions for the File System Access API. In versions of Electron containing Chrome 122+, I expect to be able to set persistent permissions, either via Chrome's UI or via a Web session broker in main. Alternatively, I expect persistent permissions will always be granted.

Actual Behavior

Although there is a new broker for handling File System Access permissions (see #28422 and its resolution in PR #41419 by @codebytere), using this function does not grant persistent permissions. This results in an Electron app using this API being unable to access a file or directory from a file handle stored in a previous session unless the user supplies a gesture (e.g. mouse click). The following error shows in console: DOMException: Failed to execute 'requestPermission' on 'FileSystemHandle': User activation is required to request permissions..

The current behaviour of 30.x means that developers would be forced to use Node FS APIs, and hence complicate their codebase when packaging a PWA as an Electron app.

Testcase Gist URL

No response

Additional Information

It should be noted that in Electron versions up to 29.x, it is possible to bypass the user gesture requirements, and essentially emulate persistent permissions, with the commandline switch enable-experimental-web-platform-features. That switch simply granted all requested permissions.

Please see #28422 (comment) and response below it for further details about this part of the File System Access API not yet being implemented in Electron.

@codebytere codebytere changed the title [Bug]: Missing support for Persistent Permissions with the File System Access API as of Chrome 122 [Enhancement]: Missing support for Persistent Permissions with the File System Access API as of Chrome 122 May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants