Fix download saver on Firefox

Turns out that Firefox needs the link to be in the document before it
will honour the click on it.
print-window-tiddler
Jeremy Ruston 2013-05-23 11:26:47 +01:00
rodzic 4ad6f05010
commit 1e5842dc1c
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -24,7 +24,9 @@ DownloadSaver.prototype.save = function(text) {
link.setAttribute("target","_blank");
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
link.setAttribute("download","tiddlywiki.html");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
return true;
};