title: How to set a file name using window.open
body: <p>I'am trying to download temporary result calculated by JavaScript. Say I have a string <code>str</code>, I want to download a file contains <code>str</code> and named it as <code>data.csv</code>, I'm using the following code:</p>
  
  <pre><code>window.open('data:text/csv;charset=utf-8,' + str);
  </code></pre>
  
  <p>The file can be successfully downloaded, but how can I name the file <code>data.csv</code> automatically rather than set the name by hand each time?</p>