I want to invoke a download such that it will open the file chooser dialog in the last place they've saved a file to. This is the functionality you get when you download something manually as a user and have the browser setting enabled to "Ask where to save each file before downloading".
E.g. if you save a file to C:/Pictures, then use my addon to download something, it should bring up the file chooser dialog and start at C:/Pictures.
A related bug report for Chrome is here: https://bugs.chromium.org/p/chromium/issues/detail?id=838952&q=chrome.downloads.download&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified
For a small workaround to do this on Chrome, I specify saveAs: true in my download options:
chrome.downloads.download({
url: '...',
saveAs: true,
});
This gives me the functionality I'm looking for on Chrome. However, on Firefox, it will always start the file chooser dialog in C:/Users/MikeY/Downloads, since that is my default downloads directory. If I don't specify saveAs: true for Chrome, it will do the same thing.
Is there any similar workaround for Firefox? Perhaps I can read the browser setting browser.download.lastDir somehow and specify that in filename?