title: $window.open called in a promise breaks the second promise
body: <p>I am pretty new to angularjs. Love it but sometimes get surprises that I just can't find an answer.</p>
  
  <p>I have a function that lets the user build a list to a file by clicking a link. This can take up to a minute so the user can build different lists at the same time. The meaning is that once the file is build a popup appears to download it.
  All of this works when only 1 file is build. After a half a minute the download popup shows up. But when 2 are build at the same time the second POST is cancelled (it arrives in the error callback) once the pop-up of the first appears.</p>
  
  <p>If I remove $window.open both POST are finished succesfully and I get both fileId's in the console log.</p>
  
  <p>Clearly the problem lies with $window.open. But why? What am I doing wrong or how can I solve this? Anyone an idea? I have been searching for hours already but can't seem to find anything on this case.</p>
  
  <pre><code> $scope.idPromise = $http.post(restPath, $scope.data)
                .then(function(data){
  console.log(data.data);
  console.log(data.data.fileId);
  $window.open(restPath + 'files/' + data.data.fileId, '_self');
  },function(error){
  console.log('promise error')
              });
  </code></pre>
  
  <p>So when two lists are build without window.open in the code I get something like this in my console:</p>
  
  <blockquote>
    <p>POST <a href="http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden" rel="nofollow">http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden</a> 200 OK 1m   </p>
    
    <p>POST <a href="http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden" rel="nofollow">http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden</a> 200 OK 1m 40s   </p>
    
    <p>report3545743463669473959.xlsx</p>
    
    <p>report4733168386603499105.xlsx</p>
  </blockquote>
  
  <p>when window.open is placed in the code:</p>
  
  <blockquote>
    <p>POST
    <a href="http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden" rel="nofollow">http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden</a>
    200 OK 1m</p>
    
    <p>POST
    <a href="http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden" rel="nofollow">http://localhost:8080/xxx-rest/rest/lijsten/vastelijsten/gezinshoofdenMetLeden</a>
    x 56,39s  </p>
    
    <p>report1588183186872251177.xlsx</p>
    
    <p>promise error</p>
  </blockquote>
  
  <p>As you can see the last POST is stopped as soon as the first POST gets a response, so for the second POST no response is gotten.</p>
  
  <p><strong>Update</strong></p>
  
  <p>It seems the problem lies with the grunt server and the liveReload Protocol. My college had always told me to ignore this error but it is now clear that because the page loses connection that the promise fails.</p>
  
  <p>Does anyone have experience with grunt and liveReload? Can I fix this? Will it work on a production server?</p>
  
  <p>The console error I get:</p>
  
  <blockquote>
    <p>De verbinding met ws://localhost:35729/livereload werd onderbroken
    tijdens het laden van de pagina. this.socket = new
    this.WebSocket(this._uri);</p>
  </blockquote>
  
  <p>(translated: the connection with... was interrupted)</p>