Closed
Bug 355482
Opened 18 years ago
Closed 18 years ago
Allow window.focus (raise/lower windows) on other windows at times when popups are allowed
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: jst)
References
Details
(Keywords: verified1.8.1.1)
Attachments
(2 files)
556 bytes,
patch
|
sicking
:
review+
sicking
:
superreview+
jay
:
approval1.8.1.1+
|
Details | Diff | Splinter Review |
339 bytes,
text/html
|
Details |
Sites with multiple windows can't raise background windows, even in response to clicks (see complaints in bug 355428 and bug 351013). IMO, they should be allowed to raise other windows at times when they can create new windows, such as in response to clicks.
Note that I'm suggesting that this be restricted to focusing *other* windows. Allowing a script to focus its own window (the one in which the click happened) would do little other than make onclick popunders possible, and popunders have little use other than hiding the origin of an intrusive advertisement.
(Changing my mind slightly from what I said in bug 299424 comment 7.)
Comment 1•18 years ago
|
||
I'm the reporter of bug 355428, I just wanted to say that I prefer this solution to my previous suggestion, which had been to use a yellow notification bar indicating that a raise request was blocked.
I think this is a pretty serious bug, as from the user's perspective it breaks a lot of sites that use popup windows. It's really frustrating as a user to click on a link and have nothing at all happen.
Comment 2•18 years ago
|
||
Reproducible: Always
Steps to Reproduce:
1. Make sure "Allow scripts to raise/lower popup windows" is off (the FF2 default)
2. Go http://www.quirksmode.org/js/popup.html
3. Click on the "open popup" link about 20% down the page
4. After the popup raises, click back to the main window and click "open popup"
again
Actual Results:
Nothing happens (the popup is updated in the background, but not foregrounded).
Expected Results:
The window should foreground.
Reporter | ||
Comment 3•18 years ago
|
||
*** Bug 358385 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 4•18 years ago
|
||
The new default setting in Firefox 2 has led to a moderate number of bug reports. I think most of those bug reports are essentially due to this bug, with a few that are attempts to do wacky things that we want to continue to disallow (e.g. pop-under ads, fake modal dialogs).
Flags: blocking1.8.1.1?
anyone interested in a (kind of...) workaround, javascript code follows for a function to open pop-ups (javascript needs to be included in the opening window AND the pop-up window)
var is_focussed=false;
window.onfocus=new Function("is_focussed=true");
window.onblur=new Function("is_focussed=false");
function ow(url, wid, hig, nam)
{
var nw;
var extr='';
var winspec='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+wid+',height='+hig;
if(navigator.appName=="Netscape") { // mozilla allows window.focus() to be disabled in settings
nw=window.open('', nam, winspec);
if(!(typeof(nw)=="undefined"||nw.closed)) {
nw.focus();
if(!nw.is_focussed) {
extr=',screenX='+nw.screenX+',screenY='+nw.screenY;
nw.close();
}
}
}
nw=window.open(url, nam, winspec+extr);
nw.focus();
}
Comment 6•18 years ago
|
||
The workaround above is helpful in some cases, but closing and reopening the popup just to refocus it isn't always viable... If the user was in the middle of filling out a form in the popup, reopening it would cause them to lose their form state. They would also lose their scroll position, which might be a problem in popups with a lot of content.
Reporter | ||
Comment 7•18 years ago
|
||
The fact that such a workaround exists is a pretty good argument the fix I suggested in comment 0 is the right one (in that it doesn't allow new annoying behavior, but does allow things that should work to work well).
Comment 8•18 years ago
|
||
Who can I bribe to help get this fixed in time for Firefox 2.0.1?? :-)
Comment 9•18 years ago
|
||
*** Bug 360198 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 10•18 years ago
|
||
This change should be what we need, but unfortunately I can't seem to test this as raising windows on my linux system doesn't seem to work no matter what prefs I set. Any testing anyone else can do would be greatly appreciated.
Reporter | ||
Comment 11•18 years ago
|
||
Reporter | ||
Comment 12•18 years ago
|
||
The patch seems to fix the bug on Mac. Thanks, jst!
It might be better if it were restricted to focusing *other* windows as I suggested in comment 0, so that on-click pop-unders continue to be disallowed. But on the other hand, maybe there are legitimate reasons to re-focus the main window immediately after opening new windows.
Comment 13•18 years ago
|
||
*** Bug 361237 has been marked as a duplicate of this bug. ***
Comment 14•18 years ago
|
||
Needs to land on the trunk if this is the right fix.
Assignee: general → jst
Flags: blocking1.8.1.1? → blocking1.8.1.1+
Comment on attachment 245296 [details] [diff] [review]
This should fix this.
I'm not super exited, but I doubt it'll be abused. If it is we can always revisit and possibly come up with a better api.
Attachment #245296 -
Flags: superreview+
Attachment #245296 -
Flags: review+
Assignee | ||
Comment 16•18 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 17•18 years ago
|
||
Comment on attachment 245296 [details] [diff] [review]
This should fix this.
Since this bug got nominated and approved for 1.8.1.1 I'm requesting approval for this patch, but I must say I question the need for this on the branch.
Attachment #245296 -
Flags: approval1.8.1.1?
Comment 18•18 years ago
|
||
Is this bug Mac only? If so, why?
Comment 20•18 years ago
|
||
Jesse or anyone: Based on jst's comment #17, is it critical to fix this on the 1.8.1 branch?
Johnny/Jonas: How risky is this patch for the branch?
Assignee | ||
Comment 21•18 years ago
|
||
(In reply to comment #20)
> Johnny/Jonas: How risky is this patch for the branch?
I would rate the risk with taking this on the branch extremely low.
Comment 22•18 years ago
|
||
Comment on attachment 245296 [details] [diff] [review]
This should fix this.
Thanks for the info Johnny. Approved for 1.8.1 branch, a=jay for drivers. Please land asap. Thanks.
Attachment #245296 -
Flags: approval1.8.1.1? → approval1.8.1.1+
Updated•18 years ago
|
Whiteboard: [checkin needed (1.8 branch)]
Comment 24•18 years ago
|
||
Doesn't happen to me.
Assignee | ||
Comment 25•18 years ago
|
||
What doesn't happen to you? And on what branch/platform etc?
Reporter | ||
Comment 26•18 years ago
|
||
*** Bug 362105 has been marked as a duplicate of this bug. ***
Comment 27•18 years ago
|
||
WFM:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1pre) Gecko/20061130 BonEcho/2.0.0.1pre
Status: RESOLVED → VERIFIED
Keywords: verified1.8.1.1
Updated•18 years ago
|
Keywords: fixed1.8.1.1
Whiteboard: [checkin needed (1.8 branch)]
Reporter | ||
Comment 29•15 years ago
|
||
Filed bug 502824 on the idea in comment 0 that would prevent pop-unders.
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•