I needed to make the same newly created file and ensure that it downloads in the Chrome extension. Here you see a code snippet using ES6 and recommended methods:
let docContent = ... ; let doc = URL.createObjectURL( new Blob([docContent], {type: 'application/octet-binary'}) ); chrome.downloads.download({ url: doc, filename: filename, conflictAction: 'overwrite', saveAs: true });
You must also declare the correct privilege in manifest.json :
"permissions" : ["downloads"]
Jonatan KaΕΊmierczak
source share