Default Downloads Directory

downloads.download() -> filename
“A string representing a file path relative to the default downloads directory”

Is there a function that returns the path of the default downloads directory?

Not that I’m aware of, since the file system is all abstracted away. What do you want it for?

When I download a file, I want to save its URL in a sidecar file:
Sidecar File

The right way to do this is Native Messaging.
But the user has to set up the native app, and maybe install a scripting language first.

I wanted a simpler way, so the user can test the add-on immediately.

When the user saves a file in the default downloads directory (or a subdirectory), I can create the sidecar file with URL.createObjectURL() + browser.downloads.download()