title: getting max Data-Uri size in Javascript
body: <p>I want to export data as a Data URI, only if the size of the data doesn't exceed the max size of the Data URI supported by the <strong>current browser</strong> is bigger than the file I want to download.</p>
  
  <pre><code>document.location.href= "data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,"+data
  </code></pre>
  
  <p>This sometimes results in a Browser error when the file is too big, but I wish that the error could be catched before the download (to try an other method for example).</p>
  
  <p>How can I get the max Data-URI size in JS ?</p>