Below code is showing a "file not found" error in Chrome but the same code works for some other environments in chrome, and after adding some time delay it was working.
Kindly advise about the reason for the required time delay in my local environment.
var a = document.createElement('a');
a.style = "display: none";
var blob = new Blob(data, {type: "application/octet-stream"});
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);