title: How to download file client-side using Firefox browser
body: <p>I have the following code, which allows me to download a json file client-side, working perfectly in Safari and Chrome:</p>
  
  <pre><code>function downloadObjectAsJson(exportObj, exportName){
    var dataStr = "data:text/json;charset=utf-8," + 
    encodeURIComponent(JSON.stringify(exportObj));
    var downloadAnchorNode = document.createElement('a');
    downloadAnchorNode.setAttribute("href", dataStr);
    downloadAnchorNode.setAttribute("download", exportName + ".json");
    downloadAnchorNode.click();
    downloadAnchorNode.remove();
  }
  </code></pre>
  
  <p>But in Firefox nothing happens. There is no error or warning. Just nothing. Is there something about the above code that Firefox cannot utilize?</p>