Open msdobrescu opened 6 years ago
It is not possible to save files outside of the Downloads folder configured by Firefox. This is a deliberate decision by the Firefox developers.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/download
filename A string representing a file path relative to the default downloads directory — this provides the location where you want the file to be saved, and what filename you want to use. Absolute paths, empty paths, and paths containing back-references (../) will cause an error. If omitted, this value will default to the filename already given to the download file, and a location immediately inside the downloads directory.
Related BugZilla bugs: https://bugzilla.mozilla.org/show_bug.cgi?id=1342563
It may be possible to prompt once and then re-use the absolute folder if the bug gets patched. At priority P3 it could be months or years, unless someone decides to contribute a patch in the near future.
Interesting, why is it possible to download in any place with Firefox? I can save anywhere I please with Firefox's download manager.
@msdobrescu Simply because the native Firefox manager and downloads are using internal Firefox code. They are not written as web extensions and therefore have no restrictions in what they can do.
I wonder whether something would be possible through native messaging, e.g. leveraging the native ext extension. That would allow packaging an additional script with the extension, which native-ext would then execute as a normal node.js script, so that additional script would have full user-level access to the file system.
Then, in the main extension you could detect if native-ext support is available, and if yes, unlock the ability to choose an arbitrary target path. Then,
It is difficult to set a relative download path. Please add absolute download path support, if WE allows it. Thank you.