title: Open jsPDF created pdf in Chrome's new tab/window
body: <p>How can I open with javascript link <code>data:application/pdf;filename=generated.pdf;base64;DATA</code> in Chrome 71?<br>
  Link from console opened successfully, but not from code - unfortunately.<br>
  The snippet does not work for security reason. Only for code demonstration.<br>
  I read some similar questions, but did not find an answer.</p>
  
  <p><a href="https://i.stack.imgur.com/8rpyX.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8rpyX.gif" alt="enter image description here"></a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var button = document.getElementById("button");
  
  button.addEventListener("click", generate, false);
  
  function generate() {
  
    var doc = new jsPDF({
      orientation: "l",
      unit: "mm"
    });
  
    doc.text('ACT', 130, 20);
    var string = doc.output('datauristring');
    console.log(string);
    var link = document.createElement('a');
    link.href = string;
    link.setAttribute('target', '_blank');
  document.body.appendChild(link);
    link.click();
    link.parentNode.removeChild(link);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://unpkg.com/jspdf@1.5.3/dist/jspdf.min.js"&gt;&lt;/script&gt;
  &lt;button id="button"&gt;Generate pdf table&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>