title: Open Base64 in new tab
body: <p>I have a Base64 encoded document which can be PDF file or image.
  I would like to create a button in HTML5 page that opens this base64 in a new tab (or new page it does not matter)</p>
  <p>I found this code can do the trick :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="http://chriscoyier.net" 
     onclick="window.open(this.href); return false;" 
     onkeypress="window.open(this.href); return false;"&gt;
       This link will open in new window/tab
  &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>It works well.
  But when I replace the http link with</p>
  <pre><code>href=&quot;data:application/octet-stream;base64,/9j/4A..&quot;
  </code></pre>
  <p>then the file is downloaded but not displayed in browser.</p>