tags:

views:

289

answers:

1

My guess is that the answer is no, but I'm just curious if anyone has any ideas.

+2  A: 

It was done that way intentionally, because of security considerations. So you're basically correct, there's no easy way.

However if you're running a web application that opens up windows, the "main" window can keep a list of handles to open windows. You could initialize an array like so:

var openWindows = [];

and then have a window opening method that looks like:

function openWindow(url, ... etc)
{
    var w = window.open(url, ... etc);
    openWindows[openWindows.length] = w;
}

Assuming you used this method to open all other windows, and assuming you could hang on to the collection (if the main window navigates to another page, the array will be lost) you will have your list of windows. You can find out how many of them are still open by iterating through the array and checking the "window.closed" property.

Barry Fandango