Is it possible to determine if a named window is open in JavaScript?
<p>I'm working on an inter-site single-sign-on project and have had a pretty little problem dropped in my lap.  When a user logs out of the "parent" site, a particular page needs to be loaded in the popup window containing the "child" site.  However, I can't store a reference to the return value of <code>window.open(…)</code>, because the user must be allowed to navigate wherever they like on each site before logging out.</p>

<p>This would be easy if I could assume that the child site is always open, as another <code>window.open(…)</code> to the same named window would change its URL.  However, the popup <strong>cannot</strong> be caused to appear if it isn't already open (not all users have access to the child site).</p>

<p>I think this gives me two conflicting scenarios.  When the user visits the child site:</p>

<ol>
<li>User logs in to parent site.</li>
<li>User clicks link for child site</li>
<li>Child site appears in a window named "child_popup".</li>
<li>User browses far and wide in the parent site, forgetting that the child window exists.</li>
<li>User logs out of parent site.</li>
<li>Child popup is redirected to the child site's logout page.</li>
</ol>

<p>And when the user does not or cannot visit the child site:</p>

<ol>
<li>User logs in to parent site.</li>
<li>User browses far and wide in the parent site.</li>
<li>User logs out of the parent site.</li>
<li>No popup should appear!</li>
</ol>

<p>So my limitations are:</p>

<ul>
<li>I cannot store a reference to the window in JS, as the user may navigate to any number of pages between visiting the child site and logging out.</li>
<li>I have <strong>zero</strong> control over the contents of the child site (my employer runs the parent site).</li>
<li>The parent site cannot be converted to frames to provide a "global" JS scope. :-)</li>
</ul>

<p>I was not able to find any relevant resources on Google or SO.  Is there a way to accomplish this?</p>
