title: Is there a way to download an encoded file with window.open?
body: <p>I'm using this code to download a file on click:</p>
  
  <pre><code>    var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(this.data, null, "\t"));
      var dlAnchorElem = document.createElement('a');
      dlAnchorElem.setAttribute("href", dataStr);
      dlAnchorElem.setAttribute("download", "data.json");
      document.body.appendChild(dlAnchorElem);
      dlAnchorElem.click();
  </code></pre>
  
  <p>Due to some restrictions on the browsers I'm working with (inApp for android), this code does not work. So I'm thinking of a workaround..</p>
  
  <p>I could use this code:</p>
  
  <pre><code>var url = "download.html";
  var windowref = window.open(url, '_blank', 'location=no,closebuttoncaption=Cerrar,toolbar=yes,enableViewportScale=yes');
  </code></pre>
  
  <p>But since my content is dynamically generated (a dump of a json object), I can't pass it to download.html. Is there a way where window.open would take an encoded value in the URL parameter, so that when the new window opens, it would instantly download the file?</p>