title: How to trigger a download of an audio link using JS, without having the browser navigate to a new page?
body: <p>I want to write a script that downloads some audio files from a web page. Problem is, that simulating the &quot;click&quot; via element.click() doesn't work well, because the browser simply navigates to the URL of that anchor element.
  For example:</p>
  <pre><code>&lt;a href=&quot;https://www.somesite.com/someAudioFile.mp3&quot;&gt;&lt;/a&gt;
  
  const link = document.querySelector('a');
  
  link.click();//Navigates to the url...
  </code></pre>
  <p>What I need, is to be able to collect all those links that I need, and simply trigger the download, <strong>without the save-as dialogue appearing</strong></p>
  <p>Is it possible? If so, how?</p>