Small revision to previous commit, avoids double encoding.

We don't need to encodeURIComponent at all when using blob links.
The data never goes into the dom directly, just a guid reference.

This makes saving with blobs very fast!
This commit is contained in:
natecain 2013-09-17 15:15:38 -04:00
parent aef8e63cf8
commit c45f4d1c62
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ DownloadSaver.prototype.save = function(text) {
var link = document.createElement("a");
link.setAttribute("target","_blank");
if(Blob != undefined) {
var blob = new Blob([encodeURIComponent(text)], {type: "text/html"});
var blob = new Blob([text], {type: "text/html"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
link.setAttribute("href","data:text/html," + encodeURIComponent(text));