1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

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.
This commit is contained in:
Jeremy Ruston 2013-05-23 11:26:47 +01:00
parent 4ad6f05010
commit 1e5842dc1c

View File

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