JoeBro
JoeBro

Reputation: 61

Chrome Extension (v3) - Download a Uint8array file (.ts file)

I have a Uint8array (that I've created by concatenating arrayBuffers from fetching several .ts files); I am attempting to send the U8A as a message to a content script in a tab and download it by creating a virtual A element with a filename/url (URL.createObjectURL method and download="filename.extension"). However, even this is not working; any suggestions?

I've tried downloading using chrome.downloads.download({url,filename}); (with a url of arrayBuffer/uint8array/blob) URL.createObjectURL cannot be used in a serviceWorker FYI. and sending the uint8array to a CS as a message is also unsuccessful (for unknown reasons). I've also tried converting the uint8array to base64, however this method crashed the browser (the file(s) are 1gb min to 3gb max).

Upvotes: 0

Views: 167

Answers (0)

Related Questions