In the background script I have a binary blob and a file name suggestion.
Now Id like do display the “download” or a save as dialog for that blob.
Previously I just grabbed the current content window and programmatically clicked a link to the blob, but that breaks with e10s.
How can I achieve something like this directly from the background script?
Yes I had tried that from a SDKs tab.attach() content script. For some reason it does not work with blob:-urls created in the background (opening the same url in a tab works, so the url itself is fine).
Now I just got it working by passing a base64 data-url to the content script; with the obvious performance drawback for large files.
But I will leave it that way for now. I don’t really expect the files (e-books) to get any larger than say 30MB.
The nsIFilePicker seems a bit overkill to me, considering “downloading” something is an every-day web thing. And I also like to have the possibility to directly open the files, which an nsIFilePicker approach wouldn’t provide.