title: JavaScript blob filename without link
body: <p>How do you set the name of a blob file in JavaScript when force downloading it through <code>window.location</code>?</p>
  <pre><code>function newFile(data) {
      var json = JSON.stringify(data);
      var blob = new Blob([json], {type: &quot;octet/stream&quot;});
      var url  = window.URL.createObjectURL(blob);
      window.location.assign(url);
  }
  </code></pre>
  <p>Running the above code downloads a file instantly without a page refresh that looks like:</p>
  <p><strong>bfefe410-8d9c-4883-86c5-d76c50a24a1d</strong></p>
  <p>I want to set the filename as <em><strong>my-download.json</strong></em> instead.</p>