A little bit ago I asked this question about if a child can get information on its parent. But now I realize that I have a followup question that belongs on its own, rather than in comments: Can Javascript find out if any window is open?
I have a window A which can either be called from window B or window C. However, when I close A, I want certain things in the onUnload
only to happen if window C is closed. Now, A may not have been opened by C, so I can't rely on window.opener
. Is there any way I can find out information on arbitrary windows? I thought about checking window.opener.location
but that still requires that C have been the opener, which it may not have been. The names of all the windows are known, so if I could search by those, I'd be golden.
(as for the why: A is a chat console, B is the main menu, C is the queue monitor. When someone is in the queue monitor, they're marked as available for chat. But to actually chat, they have to load up the chat console to do so. Normally, when you close the chat console, an onUnload
tries to mark you unavailable, but I don't want to that to happen if the queue monitor is still open.)