title: Why doesn't onload event work on a tab opend with window.open?
body: <p>I open a new blank tab. Now from this tab I need to open a website in a new tab. I do this as following. In its console I write:  </p>
  
  <pre><code>var wild = window.open("https://css-tricks.com/", "mywin", '');
  </code></pre>
  
  <p>That works fine. Now I have the access of this new window with <code>wild.document</code>. Now I wish to execute some code on that page after its dom will have been loaded. I use the <code>onload</code> event as:  </p>
  
  <pre><code>function foo(){
      var mytext = wild.document.body.textContent;
      alert( mytext );
  }
  wild.addEventListener("load", foo);
  </code></pre>
  
  <p>But unfortunately the alert doesn't happen. I also tried putting the event listener in anonymous self calling function as <a href="https://stackoverflow.com/a/12659656/3429430">explained in this answer</a>, but that didn't work too. I also tried ondomload event but unfortunately that didn't work too. So,  </p>
  
  <blockquote>
    <p>Why doesn't onload event work on a tab opend with window.open? And How to get it working properly?</p>
  </blockquote>