mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
commit
9616b5586f
@ -28,7 +28,12 @@ DownloadSaver.prototype.save = function(text) {
|
||||
// Set up the link
|
||||
var link = document.createElement("a");
|
||||
link.setAttribute("target","_blank");
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
if(Blob != undefined) {
|
||||
var blob = new Blob([text], {type: "text/html"});
|
||||
link.setAttribute("href", URL.createObjectURL(blob));
|
||||
} else {
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
}
|
||||
link.setAttribute("download",filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
Loading…
Reference in New Issue
Block a user