timing issue with detecting window.innerHeight
<p>I have a page that I open as a popup using window.open from another page; at this point the <code>window.open</code> call specifies a given height and width for the popup page.</p>

<p>In the popup page I detect the available screen size using <code>window.innerHeight</code> and <code>window.innerWidth</code> (and similar for crossbrowser compatibility).</p>

<pre><code>window.onload = function() { 
   if (window.innerWidth &amp;&amp; window.innerHeight) { 
      ww = window.innerWidth; wh = window.innerHeight; 
   } ` 
</code></pre>

<p>This sometimes fails to work if the popup is openend using this: </p>

<pre><code>newHeight = 400; 
newWidth = 400; 
window.open("popup.html", "", "height=" + newHeight + ",width=" + newWidth);
</code></pre>

<p>The issue I'm having is that I have sometimes timing issues with the height/width detection; under some circumstances, the height/width returned are not the ones the popup window has been set to, but some other values (it looks like the values of the opener window).</p>

<p>It looks like the <code>window.innerHeight</code> is detected before the height/width settings of the popup window are enforced.</p>

<p>Normally, in the popup I detect height and width within a <code>window.onload</code> function.
I believe this might be a timing issue because the issue disappears if I add a timeout delay of 30ms, with a shorter delay the issue might still happen.</p>

<p>Question: is there an event in the opened window that ensures me that the height/width settings of the openers' <code>window.open</code> have been applied?</p>
