Fix incorrect downloaded file extension (#8928)

* Fix incorrect downloaded file extension

* Update docs
This commit is contained in:
Leilei332
2025-02-14 18:17:00 +00:00
committed by GitHub
parent 2a2d998bef
commit fbe5a2f908
8 changed files with 14 additions and 5 deletions
+2 -2
View File
@@ -232,10 +232,10 @@ $tw.utils.error = function(err) {
var link = dm("a"),
text = JSON.stringify(tiddlers);
if(Blob !== undefined) {
var blob = new Blob([text], {type: "text/html"});
var blob = new Blob([text], {type: "application/json"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
link.setAttribute("href","data:application/json," + encodeURIComponent(text));
}
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
document.body.appendChild(link);