Closed
Bug 131838
Opened 24 years ago
Closed 24 years ago
window.focus() interacts badly with link target
Categories
(SeaMonkey :: UI Design, defect)
Tracking
(Not tracked)
VERIFIED
WORKSFORME
People
(Reporter: chris+bugzilla, Assigned: saari)
References
()
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.9+)
Gecko/20020313
BuildID: 2002031308
When writing code to handle popping a new window in both cases where javascript
is and is not enabled, I like to use both a target="_blank" and a window.open
call. However, when window.focus() is used in conjunction with window.open, it
interacts badly with the link target.
Reproducible: Always
Steps to Reproduce:
1. Make sure JS is turned on
2. Go to the url http://www.clotho.com/staff/chris/moztest/toomanywindows.html
3. click the four links, closing the opened windows each time
Actual Results: the first link pops two windows: apparently one via window.open
and one via target="_blank". The other three urls correctly only pop one via
window.open
Expected Results: Only one popped window in all four cases
I have only tested Mac OS X. I think it's likely a cross-platform bug however.
Comment 2•24 years ago
|
||
I get one window each for all four links on 0.9.9/Win98. Maybe MacOS only, or
only post-0.9.9?
| Reporter | ||
Comment 3•24 years ago
|
||
re: post-0.9.9 comment above
I have now reproduced this on Mac OS X in nightlies from 2002-03-13, 2002-03-18,
and 2002-01-25
| Reporter | ||
Comment 4•24 years ago
|
||
I did some further testing with a clean profile and realized that there are two
more crucial steps to reproduce this bug:
1. Turn on JS
2. Disable JS ability to raise/lower windows
3. Save prefs, quit moz, relaunch
4. Go to the url http://www.clotho.com/staff/chris/moztest/toomanywindows.html
5. click the four links, closing the opened windows each time
Sorry I didn't think to try it with a clean profile right away.
Comment 5•24 years ago
|
||
argh! now that you mention it, I have JS popups disabled, so of course it
worked for me. I'm an idiot...
Comment 6•24 years ago
|
||
Linux i386 (RH 7.x RPMs) 0.9.9 also produces two windows for the first link.
Raise/Lower windows was unchecked in prefs.
| Reporter | ||
Comment 7•24 years ago
|
||
I think the answer is that with the raise/lower disabled, the JS function dies
when trying to focus, and for some reason I do not understand, the non-JS
targetted link then fires. My expecation is that since the function died, the
return value would be null, so the onClick="return popup(true)" would be
evaluated as null, and thus the link would not fire. But perhaps I am
incorrectly interpreting what happens when a JS exception is thrown.
Is this all attributable to a mistake I am making in javascript or is this a
real bug? Do I need to go back into all my old javascript and add
error-checking before every call to window.focus?
| Reporter | ||
Comment 8•24 years ago
|
||
Reporter: This now WFM. I don't know when it was fixed, but thanks to whoever
did it!
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Updated•21 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•