title: Automatic Multiple Download No Longer Working On Chrome
body: <p>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.</p>
  
  <p>We show a list of saved sessions &amp; when the user clicks "Download" we loop through all recordings for that session and download them like in this SO solution:
  <a href="https://stackoverflow.com/questions/19327749/javascript-blob-filename-without-link">JavaScript blob filename without link</a></p>
  
  <pre><code>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 &lt; matchedRecordings.length; i++){
          var recording = matchedRecordings[i];
          saveBlobAs(recording.blob, fileName);
      }
  </code></pre>
  
  <p>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</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>But now Chrome sees it as a popup and opens new tabs for each file.</p>
  
  <p>Has anybody else had the same problem? Is there a better solution than opening each link in a new tab?</p>