Skip to content

Commit 6387305

Browse files
authored
Merge pull request kennethjiang#18 from MaxGraey/master
dispose blobURL
2 parents 33cc758 + 4524750 commit 6387305

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

file-download.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ module.exports = function(data, filename, mime) {
1010
else {
1111
var blobURL = window.URL.createObjectURL(blob);
1212
var tempLink = document.createElement('a');
13+
tempLink.style = "display: none";
1314
tempLink.href = blobURL;
1415
tempLink.setAttribute('download', filename);
1516
tempLink.setAttribute('target', '_blank');
1617
document.body.appendChild(tempLink);
1718
tempLink.click();
1819
document.body.removeChild(tempLink);
20+
window.URL.revokeObjectURL(blobURL);
1921
}
2022
}

0 commit comments

Comments
 (0)