title: Create a Blob and open it in the browser with a desired URL
body: <p>I have written the following code to create a file using a blob and open it automatically(instead of downloading) in the browser(Chrome).</p>
  
  <pre><code> var saveData = (function () {
      var a = document.createElement("a");
      document.body.appendChild(a);
      a.style = "display: none";
      return function (data, fileName) {
          var json = JSON.stringify(data),
              blob = new Blob([json], {type: "text/html"}),
              url = window.URL.createObjectURL(blob);
          window.open(url);
         window.URL.revokeObjectURL(url);
      };
  }());
  
  var data = { x: 42, s: "hello, world", d: new Date() },
      fileName = "my-download.json";
  
  saveData(data, fileName);
  </code></pre>
  
  <p>JSfiddle : <a href="http://jsfiddle.net/cW7W5/611" rel="nofollow">http://jsfiddle.net/cW7W5/611</a><a href="http://jsfiddle.net/cW7W5/611/" rel="nofollow">1</a></p>
  
  <p>The file open successfully in a new browser window as </p>
  
  <blockquote>
    <p>blob:http%3A//fiddle.jshell.net/83999d68-4d79-4a06-a83d-e40a8b1f9681</p>
  </blockquote>
  
  <p>But what I want to open it in a url that I specified. For example </p>
  
  <blockquote>
    <p>blob:http%3A//fiddle.jshell.net/<strong>exapmle.txt</strong></p>
  </blockquote>