Mozilla 1.2 - Closed Window Loses Properties
Posted: Mon Oct 27, 2003 4:52 pm
Hi, First Post!
For some time I have been using the following script to close child windows when the parent window disappears. It worked fine in Moz 0.9 and various IE versions.
Having gone throug some recent upgrading I now find that it does not work in Moz 1.2 on Linux or Mac. In the Javascript Console I get the message 'window.opener has no properties'.
It seems that when the parent window is closed is destroying the properties it's window object. Formerly the boolean value window.closed was preserved and set to true.
Q1. Is this a genuine bug? I searched Bugzilla (horrible form) but could not any reference.
Q2. Is there a work arround? I have tried but this just throws the same error.
Many Thanks,
For some time I have been using the following script to close child windows when the parent window disappears. It worked fine in Moz 0.9 and various IE versions.
Code: Select all
function checkParent()
{
if (window.opener)
{
if (window.opener.closed)
{
window.close();
}
}
}
var checkParentIntervalID = window.setInterval("checkParent()", 500);It seems that when the parent window is closed is destroying the properties it's window object. Formerly the boolean value window.closed was preserved and set to true.
Q1. Is this a genuine bug? I searched Bugzilla (horrible form) but could not any reference.
Q2. Is there a work arround? I have tried
Code: Select all
if (typeof(window.opener.closed) == undefined) ...Many Thanks,