title: New tab under a child window in javascript
body: <p>I have two different applications server A and B, there's a link in the window of A, who opens a new window of B. </p>
  
  <p>My request now is: in the second click on A, I want to open a new tab in the window of B. An example of what I did: </p>
  
  <pre><code>&lt;button onclick="myFunction()"&gt;Try on&lt;/button&gt;
  &lt;script&gt;
    var myWindow;
   function myFunction() {    
    if(!myWindow) {
  myWindow=window.open('https://google.com',"","width=500,height=500,toolbar=yes,resizable=1");
  myWindow.focus();
   } 
   else {
     myWindow=myWindow.open('https://google.com',"_blank");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>In the first click the window appears and opens google but in the second click that's not working.</p>
  
  <p>Can you help xD</p>
  
  <p>If it's duplicate question please give me the link :) </p>