Blob
using createObjectUrl
.a
and use the url generated above. Set properties such as a.download
and a.href
on this a
. Use a.click
to click on this a
.Here is the function.
saveBlob : function(blob, filename) {
var url = window.URL.createObjectURL(blob);
var a = document.createElement("a");
a.target = "_blank";
a.href = url;
a.download = filename;
a.onclick = function(e) {
setTimeout( () => {
window.URL.revokeObjectURL(url);
}, 100);
};
a.click();
a.remove();
},