From a Firefox add-on implemented as a WebExtension, I'd like to let the user choose a local directory, if possible with the standard directory picker dialog (a variant of the "open file" dialog).
Can this be done from a WebExtension? If so, how?
(In regular JavaScript/HTML on a website, it's not possible for security reasons. See e.g. Select directory path in JavaScript. But as an Add-on should be somewhat trusted by the user, I wonder whether it's possible there.)
Context: I'd like to make a simple bulk downloader, that lets the user choose a target directory for multiple to-be-downloaded files rather than just throwing all of them into the default Downloads folder, but without showing the "Save as" dialog for each individual download.