
Don't wait for the user to click it, activate it ourselves! Activate it by adding it to the HTML body Make sure it's not visible when added to the HTML body Set the link destination as hard-coded file data.ĮtAttribute('href', 'data:text/plain charset=utf-8,' + encodeURIComponent(strContent)) ĮtAttribute('download', strFilename) Var element = document.createElement('a') Create the hyperlink for a user to click Var strContent = Pointer_stringify(textContent) Var strFilename = Pointer_stringify(filename) to do this, as long as you know THAT you need to.

It's not too important to realize why you need Convert paramters to the correct form. BrowserTextDownload: function(filename, textContent)
