Force browser to download file javascript
25 Oct 2019 The download() function of the downloads API downloads a file, given its var downloading = browser.downloads.download( options // object ) createObjectURL() to download data created in JavaScript and you want to
11 Feb 2019 Forcing a file to be downloaded by the browser (user) seems hard because we do not have a native Javascript function to do that. I know why
If you use a link then the download attribute can be used to set the file name (if the browser supports it). Chrome supports this attribute and so does Firefox in general. Though I'm not sure if it works in Firefox with object URLs, because in Firefox it only works if the downloaded file is from the same origin than the page.