Skip to content Skip to sidebar Skip to footer

Javascript - File Saved To Disk Is Stuck In Chrome's Memory

I have this code: function saveFile(str, part) { var textFileAsBlob = new Blob([str], {type:'text/plain'}); var fileNameToSaveAs = 'Parsed audio - part '+part; var downloadL

Solution 1:

As my comment seemed to be the answer you were looking for, I've put it as an actual answer


You're not releasing the blob URL after the click, which means the GC can't get rid of the blob

// after the click
URL.revokeObjectURL(downloadLink.href);

Post a Comment for "Javascript - File Saved To Disk Is Stuck In Chrome's Memory"