title: Open new tab in the same browser window after some event
body: <p>For some of you this question may seem to be stupid, but I don't think so...</p>
  
  <p>So, basically what I want to achieve is to open new tab by javascropt in the same browser window, but it mustn't be opened by clicking on something. I've tryed several things... </p>
  
  <p>window.open(url,"_blank") somehow doesn't work for google chrome, it opens whole new window of chrome...</p>
  
  <p>then I tried something like this</p>
  
  <pre><code>`&lt;a href="" target="_blank" id="link"&gt;&lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      function OpenNewTab(link){
          var a = $('a[target="_blank"]')[0];
          a.setAttribute('href', link);
  
          // document.getElementById("link").click();
          // a.click();
      }
  &lt;/script&gt;`
  </code></pre>
  
  <p>anyways if I comment out any of the lines, it still does the same, but if I change first line of code to this</p>
  
  <pre><code>`&lt;a href="" target="_blank" id="link"&gt;Click Here&lt;/a&gt;`
  </code></pre>
  
  <p>and click it, it of course works fine...</p>
  
  <p>as a reminder, all this things apear to be working for me on firefox</p>
  
  <p>Note: don't forget that all I want is to open tab after something happens in my code, not after user clicks on something</p>