Window or tab closes with link with window.open(this.href, '_top'); window.close();

RESOLVED DUPLICATE of bug 212298

Status

RESOLVED DUPLICATE of bug 212298
15 years ago
14 years ago

People

(Reporter: frank.carlsson, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040514
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040514

1) Go to http://www.hm.com/se/start/start/index.jsp
2) Choose the menu "H&M ROWELLS SHOP"
3) Choose any of the menu items than turns up
4) Ignore the stupid message in swedish that i can download Internet Explorer
for free
5) Push the back button on the browser
6) repeat step 2 and 3
7) Study the silent crash

Reproducible: Always
Steps to Reproduce:
1) Go to http://www.hm.com/se/start/start/index.jsp
2) Choose the menu "H&M ROWELLS SHOP"
3) Choose any of the menu items than turns up
4) Ignore the stupid message in swedish that i can download Internet Explorer
for free
5) Push the back button on the browser
6) repeat step 2 and 3
7) Study the silent crash
Actual Results:  
The brower just crashes silently

Expected Results:  
I am sure you have a suggestion ;-)

I'm using:
Mandrake 10.0
Gnome
Shockwave Flash 6.0 r81
(Reporter)

Comment 1

15 years ago
It just happends to the present browser window, not the whole browser. I found
that out when I had several brower windows running

/Frank

Comment 2

15 years ago
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a2) Gecko/20040602

changing OS to all, as I´m seeing this also on Windows.
I had opened the page in a tab, and on reload the tab crashed, the other tabs
were unaffected. I retried about five times, didn´t see memory consumption, only
crash of that tab, others working undisturbed.

JS console gives some warnings and an error:

Warning: redeclaration of var html
Source File: http://www.hm.com/se/start/start/index.jsp
Line: 272, Column: 5
var html = "<table width='525' cellspacing='0' cellpadding='0' border='0'>"

Error: uncaught exception: Permission denied to get property Window.msOverHandler

Warning: The stylesheet http://shop.hm.com/shop/css/shop_common.css was loaded
as CSS even though its MIME type, "application/octet-stream", is not "text/css".
OS: Linux → All

Comment 3

15 years ago
forgot to tell that Talkback and DocWatson are installed, but didn´t come up.
I guess they give you a warning first time, and kill the window second time,
but I don´t have the time to look at this now.
There's no crash, at least not for me with build 2004-06-02-08 on Windows XP.

I have both browser and mail windows open, and it simply closes the browser window.

Since mozilla.exe (on windows) is the same binary, a crash in browser will bring
down the whole app.

My guess is something is doing a window.close() call?
I think I have the cause of the bug:
<html><head></head>
<body>
<a onclick="window.open(this.href, '_top');window.close();"
href="javascript://">Close this window</a>
</body>
</html>

Could we keep this feature, please ;)
Created attachment 149917 [details]
Clicking on the link will close your browser window
Also happens with '_top', '_self', '_content' and '_main':
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#3142

I think this is the place where things need to be fixed:
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#3457
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Crashing when choosing a drop down menu twice → Window or tab closes with link with window.open(this.href, '_top'); window.close();
Created attachment 149960 [details] [diff] [review]
Check also if the opened window is not the same as opener

Well, this seems to work for me. I'm not really sure though if this would break
something. At first glance it doesn't.
Comment on attachment 149960 [details] [diff] [review]
Check also if the opened window is not the same as opener

Uhm, would you like to review this Boris?
Attachment #149960 - Flags: review?(bzbarsky)
Not if you want review sometime in the near future (as in, before July 11).  I'm
pretty booked until then, unfortunately.
Comment on attachment 149960 [details] [diff] [review]
Check also if the opened window is not the same as opener

I'm not really in a hurry, but it would still be nice if it could be reviewed
earlier.
Attachment #149960 - Flags: review?(bzbarsky) → review?(jst)
Ehm, jst, could you review this some time in the near future? (just say yes or no)
Attachment #149960 - Flags: review?(jst) → review?(bzbarsky)
Comment on attachment 149960 [details] [diff] [review]
Check also if the opened window is not the same as opener

So... this will make it impossible to close some windows that _are_ opened by
script (eg window.open() to open, then window.open() from inside the new window
to load a new URL,  then try to close).  No?
(In reply to comment #13)
> (From update of attachment 149960 [details] [diff] [review])
> So... this will make it impossible to close some windows that _are_ opened by
> script (eg window.open() to open, then window.open() from inside the new window
> to load a new URL,  then try to close).  No?
Ehm, yes, you're right. That would become a problem indeed.

This is probably the same bug as bug 212298.
Attachment #149960 - Flags: review?(bzbarsky) → review-
Yes.

*** This bug has been marked as a duplicate of 212298 ***
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.