Closed Bug 56699 Opened 25 years ago Closed 25 years ago

window.close() crashes browser/OS

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
All
defect

Tracking

()

VERIFIED DUPLICATE of bug 54868

People

(Reporter: bht237, Assigned: jst)

References

()

Details

(Keywords: crash)

Attachments

(3 files)

The following straight forward test case at least crashes the browser or worse locks up the OS (there is no Ctrl+Alt+Del escape from this). The offending JavaScript statement is self.close() of a new window. Care has been taken to ensure that window.close() is the last statement in the script as to not produce an over-complex scenario. There is additional complexity because of the number of windows (3) involved that may not neccessarily contribute to the problem. However, this test case is an extract of a real life application crash and the configuration having 3 windows should be kept to verify any fixes. Below the 3 test file required to reproduce the crash: <!--/*starter.htm*/--> <HTML> <HEAD> <TITLE>Starter Opener</TITLE> <SCRIPT> function openNew(){ //Create new window var newWin=window.open("main.htm","main","height=400,width=400"); }//End openNew() </SCRIPT> </HEAD> <BODY> <H1>Starter Opener</H1> <FORM> <INPUT type=button value="Open Main" onclick=openNew()> </FORM> </BODY> </HTML> <!--/*main.htm*/--> <HTML> <HEAD> <TITLE>Main Window</TITLE> <SCRIPT> function openNew(){ //Create new window var newWin=window.open("slave.htm","slave","height=400,width=400"); }//End openNew() function doStuff(win){ //Do some stuff win.finishAction(); }//End doStuff() </SCRIPT> </HEAD> <BODY> <H1>Main Window</H1> <FORM> <INPUT type=button value="Open Slave" onclick=openNew()> </FORM> </BODY> </HTML> <!--/*slave.htm*/--> <HTML> <HEAD> <TITLE>Slave Window</TITLE> <SCRIPT> function finishAction(){ self.close(); }//End finishAction() function init(){ //Connect to main window var mainWin=window.open("main.htm","main","height=400,width=400"); mainWin.doStuff(self); }//End init() </SCRIPT> </HEAD> <BODY onload=init()> <H1>Slave Window must close!</H1> </BODY> </HTML>
Confirmed the crash on Linux 2000-10-14-09, but the OS did not crash :-) Adding crash keyword. OS->All. (for the record: reporter's OS was Win95). Adding the 3 files provided by reporter as attachments below. When testing, save these attachments with the proper name.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash
OS: Windows 95 → All
Attached file main.htm
Attached file slave.htm
Thanks for the great testcase! When looking at what caused this I realized that this is a dup of bug 54868 (this might seem a bit different, but the fix for bug 54868 also fixes this problem) so I'll dup this bug. *** This bug has been marked as a duplicate of 54868 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
*** Bug 56711 has been marked as a duplicate of this bug. ***
Verified Duplicate.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: