title: Prevent OPEN file prompt in microsoft edge using angular js
body: <p>I have a code in angular js which downloads an excel file on clicking a button. In chrome the file download starts automatically on clicking the button. But on Microsoft Edge clicking the button displays a prompt asking the user, whether they want to open or save file. Clicking on save button in prompt shows yet another prompt with 3 buttons OPEN, OPEN FOLDER and VIEW DOWNLOADS.
  <a href="https://i.stack.imgur.com/WEEN6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WEEN6.png" alt="enter image description here"></a></p>
  
  <p>I know that edge provides settings options to disable the prompt on each download.
  But is there any way on edge to start download but after downloading it does not show the second prompt asking what to do, using angular js or jquery?</p>
  
  <p>The code for downloading file is as follows:</p>
  
  <pre><code>                    var fileName;
                      var a = document.createElement("a");
                      document.body.appendChild(a);
                      var type = headers('Content-Type');
                      var disposition = headers('Content-Disposition');
                      if (disposition) {
                          var match = disposition.match(/.*filename=\"?([^;\"]+)\"?.*/);
                          if (match[1])
                              fileName = match[1];
                      }
                      var blob = new Blob([data], {
                              type: type
                          }),
                          url = window.URL.createObjectURL(blob);
                      if (blob.size == 0) {
                          return;
                      }
                      a.href = url;
                      a.download = fileName;
  
                      var isIE = false || document.documentMode || /Edge/.test(navigator.userAgent); //if browser is IE and Edge
                      if (isIE) {
                          window.blur();
                          window.navigator.msSaveOrOpenBlob(blob, fileName);
                      } else {
                          a.style = "display: none";
                          a.click();
                          window.URL.revokeObjectURL(url);
                      }
  </code></pre>