Closed Bug 1338770 Opened 9 years ago Closed 9 years ago

WEBEXTENSION browser.downloads.download Failed - Blob resource Firefox 51.0.1

Categories

(WebExtensions :: Untriaged, defect)

51 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1331176

People

(Reporter: tbt43p, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 Build ID: 20170201180315 Steps to reproduce: Wrote an add-on to help saving the title of a tab, url of tab and a user comment of the webpage into a file. wrote this code function salva() { var comment = document.getElementById('COMMENT').value; var titolo=document.getElementById('TITLE_TAB').value; var indirizzo=document.getElementById('URL_TAB').value; var textToSave = "<TITLE>" + titolo + "</TITLE>" + "<COMMENT>" + comment + "</COMMENT>" + "<LINK>" + indirizzo + "</LINK>" + "\n"; ///* browser.downloads.download({ url: URL.createObjectURL(new Blob([ textToSave ])), filename: "testff.txt", }) //*/ /* var blob = new Blob([ textToSave ], { type: 'text/plain' }); var url = URL.createObjectURL(blob); browser.downloads.download({ url: url, filename: 'filejjjjj.txt' }); */ var blob = new Blob(['text'], { type: 'text/plain' }); var url = URL.createObjectURL(blob); browser.downloads.download({ url: url }); } They are three snippet (two are commented out) I found to get my work done, but no one works, keeps sayind failed - blob resource. Working on Ubuntu 16.04 64 bit, Firefox 51.0.1 64 bit. Thanks Actual results: Download failed - blob resource Expected results: My extension should have downloaded the file. My question on StackOverflow for reference: http://stackoverflow.com/questions/42169569/javascript-download-an-on-the-fly-generated-blob-file-into-specific-folder
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.