title: FileSaver.js Chrome Issue, Multiple documents
body: <p>I'm using Chrome v67 and FileSaver.js.</p>
  
  <p>This code works in FF &amp; Edge but not in Chrome.</p>
  
  <pre><code>var ajaxSettings = {
      url: "my/api/method",
      data: JSON.stringify(myItems),
      success: function (data) {
          if (data) {
              var dateToAppend = moment().format("YYYYMMDD-HHmmss");
              createPdf("pdfDoc_" + dateToAppend + ".pdf", data[0]);
              saveFile("txtDoc_" + dateToAppend + ".txt", data[1]);
  
              //sleep(2000).then(() =&gt; {
              //    saveFile("txtDoc_" + dateToAppend + ".txt", data[1]);
              //});
          }
      }
  }
  
  //function sleep(time) {
      //return new Promise((resolve) =&gt; setTimeout(resolve, time));
  //}
  
  function createPdf(filename, pdfBytes) {
      if (navigator.appVersion.indexOf("MSIE 9") &gt; -1) {
          window.open("data:application/pdf;base64," + encodeURIComponent(pdfBytes));
      }
      else {
          saveFile(fileName, data);
      }
  }
  
  function saveFile(fileName, data) {
      var decodedByte64 = atob(data);
      var byteVals = new Array(decodedByte64.length);
      for (var i = 0; i &lt; decodedByte64.length; i++) {
          byteVals[i] = decodedByte64.charCodeAt(i);
      }
      var byte8bitArray = new Uint8Array(byteVals);
  
      var blob = new Blob([byte8bitArray]);
      saveAs(blob, fileName); //FileSaver.js
  }
  </code></pre>
  
  <p>The result of calling the API is an array with 2 byte arrays in it.
  The byte arrays are the documents.</p>
  
  <p>If I run this code, as a user would, then what happens is that the first document gets "downloaded" but the second does not.  Attempting to do this a second time without refreshing the page results in no documents being "downloaded".  The "download" word is in quotes because it already has been downloaded, what I'm really trying to do is generate the documents from the byte arrays.</p>
  
  <p>This is the strange bit ... if I open the console and place a breakpoint on the "saveFile" call and immediately hit continue when the debugger lands on the breakpoint then all is well with the world and the 2 documents get downloaded.</p>
  
  <p>I initially thought it was a timing issue so I put a 2 second delay on this to see if that was it but it wasn't.  The only thing I've managed to get working is the breakpoint which I'm obviously not going to be able to convince the users to start doing no matter how much I want them to.</p>
  
  <p>Any help or pointers are much appreciated</p>