Add something like nsIFilePicker.isModeSupported()
Categories
(Core :: Widget, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox119 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Most platforms have traditionally allowed us to open a native file picker that selects folders (modeGetFolder).
When installed as a Snap package on Linux, Firefox uses the xdg-desktop-portal mechanism to show file pickers, and only recently (since version 3) does xdg-desktop-portal allow clients to request pickers for folders.
In lieu of a better solution, the browser migration wizard plans to use the native file picker / xdg-desktop-portal to gain access to browser data outside of the Firefox sandbox. This is similar to what we do for Safari (see bug 1493103).
We need a way of detecting whether or not folder selection is even possible so that we don't offer instructions that simply don't work on versions of Linux with xdg-desktop-portal < 3.
What I propose is a new method on nsIFilePicker that returns a Promise that resolves if the passed in mode is supported. For Windows and macOS, this should just resolve to true on the next tick. For Linux, if dbus-enabled, we'll need to do some dbus spelunking to get the portal version number and only return true for modeGetFolder if that version number is greater or equal to 3.
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
Depends on D188131
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Backed out for causing build bustages on nsFilePicker.cpp.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=429699706&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/a45795eb36e56c76e185bb0bc4f747e81cc0af0b
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c4e3a40b1d54
https://hg.mozilla.org/mozilla-central/rev/37701fa21006
| Assignee | ||
Updated•2 years ago
|
Description
•