3

I've recently got started with FireFox's WebExtensions library as the legacy extensions were removed with the Quantum update.

My problem is that I need to save files to an absolute path from a context menu, but FF's downloads API only provides relative paths from the Downloads folder.

Does anyone know about a way to achieve this from a WebExtension?

Meki
  • 395
  • 1
  • 7
  • 13

1 Answers1

3

If you set saveAs as true in https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/download you can save to any path you like, but that requires user interaction.

If you don't want to require user interaction, you can use native messaging to save files to absolute paths. For an example of native messaging, see here: https://github.com/mdn/webextensions-examples/tree/master/native-messaging

Smile4ever
  • 3,491
  • 2
  • 26
  • 34