title: Saving file created from browser to disk - Cannot use new File() on FireFox
body: <p>The following script creates a json file in the browser and automatically save it to disk.</p>
  
  <p>It works fine with <code>Chrome 50.0.2661.87</code> m but it <strong>does not work</strong> on <code>FF 47.0a2</code> (although no errors are throw).</p>
  
  <p>Issue seems related to (as if you comment it out works):</p>
  
  <pre><code>window.URL.revokeObjectURL(link.href);
  </code></pre>
  
  <p>What is the reasons for this behavior on FF? Should I omit window.URL.revokeObjectURL() at all;</p>
  
  <p>Notes: It should works on the latest browsers Chrome and FireFox.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var saveDataToFile = function(data, fileName, properties) {
    window.URL = window.URL || window.webkitURL;
    var file = new File(data, fileName, properties),
      link = document.createElement('a');
    link.href = window.URL.createObjectURL(file);
    link.download = fileName;
    document.body.appendChild(link);
    link.click();
    window.URL.revokeObjectURL(link.href);// possible problem here
    document.body.removeChild(link)
  };
  
  var fileName = 'test.json',
    properties = {
      type: 'octet/stream'
    },
    data = [JSON.stringify({
      test: 'hello'
    })];
  saveDataToFile(data, fileName, properties);</code></pre>
  </div>
  </div>
  </p>