I\'m trying to let the user download some data as a CSV (text) file, using Javascript and the HTML5 Download attribute (http://caniuse.com/#feat=download).
The data
You might try adding the element to the DOM before triggering the click:
document.body.appendChild(link); link.click(); document.body.removeChild(link);
This worked for me in Firefox 34
jsfiddle: http://jsfiddle.net/8wos7cf8/7/