[Bug]: showDirectoryPicker returns AbortError with no alternative when a blocklisted folder is selected #42459
Labels
30-x-y
31-x-y
bug 🪲
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
platform/all
status/confirmed
A maintainer reproduced the bug or agreed with the feature
web-platform-apis
Preflight Checklist
Electron Version
30.1.0
What operating system are you using?
macOS
Operating System Version
MacOS Sonoma 14.2.1
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
N/A
Expected Behavior
If a folder with special permission, like
~/Downloads
is selected byshowDirectoryPicker
, a mechanism should exist to request OS permission and then give access to the folder to the renderer process.Failing that, it should be possible to distinguish such an
AbortError
from one that is thrown when the user selects "Cancel"Actual Behavior
When
showDirectoryPicker
is used to select a blocklisted folder, anAbortError
identical to that shown if the user presses "Cancel" is returned to the app, without any calls to the permission handlers set on the session. This makes it impossible for the app to determine whether the folder is not allowed or whether the user just decided to cancel.Testcase Gist URL
https://gist.github.com/nicole-branagan/33acff515cfc767333bd10306d17ef17
Additional Information
No response
The text was updated successfully, but these errors were encountered: