Manny Calavera
Manny Calavera

Reputation: 6873

Detect opened windows/tabs in Firefox

I have an application window that displays a button. On button click, a new tab is opened with window.open javascript function and later I would like to be able to detect if that link is opened or not and if it is, I need to close that window. Can this be done in Firefox ?

Thanks.

Upvotes: 0

Views: 590

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328604

The window.open() function returns a Window object. Just call close() on it:

var childWindow = window.open(....);

...

childWindow.close();

Upvotes: 3

Related Questions