Closed Bug 166654 Opened 22 years ago Closed 22 years ago

window.open in OnUnload fails

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 130719

People

(Reporter: sterno, Assigned: joki)

Details

Attachments

(1 file)

I have written a page that I want, when closed, to open up a new window.  To do
this I've written something that looks like this:

<script>
alreadySubmitted=0;
function submitIfNotAlready () {
    if (alreadySubmitted==0) {
        setSubmitted();
        window.open('logoutpage','eighty_seventy','width=1,height=1');
        window.open('receiptpage','mainPage');
    }
}
</script>
<body onUnload="submitIfNotAlready()">

Now, when I run this in IE it works as expected, launching two windows.  If I
run this in mozilla it doesn't work and in the javascript console I see the
following:


uncaught exception: [Exception..."Component returned failure code:
0x80004005(NS_ERROR_FAILURE)[nsIDOMJSWindow.open]" nsresult:
"0x80004005(NS_ERROR_FAILURE)" location: "JS frame ::
http://172.16.1.41/logout.jsp :: submitIfNotAlready :: line 80" data: no]

The bug happens under both Linux and Windows.  Problem exists in Mozilla 1.1 and
Mozilla 1.0 RC1
Attached file testcase
A little modification of the described testcase (added needed functions, and
changed window locations to "about:blank")...
This works perfectly fine for me. Check if you have the pop up blocker on, that
might be the problem.
This might have been fixed after 1.0 and 1.1 in bug 130719.
Summary: OnUnload Fails → window.open in OnUnload fails

*** This bug has been marked as a duplicate of 130719 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: