We produce browser based communication software that companies use for consultations. At the end of a consultation, the consultant can download recordings of the video streams. Since Chrome updated to version 65, the multiple file download only offers the last file.
We show a list of saved sessions & when the user clicks "Download" we loop through all recordings for that session and download them like in this SO solution: JavaScript blob filename without link
var saveBlobAs = function(blob, filename){
var url = window.URL.createObjectURL(blob);
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
};
for(var i = 0; i < matchedRecordings.length; i++){
var recording = matchedRecordings[i];
saveBlobAs(recording.blob, fileName);
}
The code still works perfectly on FireFox but Chrome 65 only ever offers the last file. I could fix it by changing the link creation to
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
a.href = url;
a.target = '_BLANK'; // Added this
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
But now Chrome sees it as a popup and opens new tabs for each file.
Has anybody else had the same problem? Is there a better solution than opening each link in a new tab?