Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox 2.0 - window.focus()

11 views
Skip to first unread message

DbNetLink

unread,
Nov 13, 2006, 11:16:38 AM11/13/06
to
It appears that in Firefox 2.0 it is no longer possible to bring a dependent
pop-up window to the front by calling the focus() method of the window in
question.

I have verified this by creating a sample based on "best practices"
http://developer.mozilla.org/en/docs/DOM:window.open

I'm not talking about a "modal" window, I simply want to bring a window that
a user requests to the front if the window is already open.

Is this a feature or a bug ?

If it's a bug, when will it be fixed. ?

We have spent months adding Firefox support to our applications and this one
issue has rendered them practically unusable in FF2


Mike Shaver

unread,
Nov 13, 2006, 3:40:41 PM11/13/06
to DbNetLink, dev-te...@mozilla.org, dev-apps...@lists.mozilla.org
On 11/13/06, DbNetLink <in...@notthisdbnetlink.co.uk> wrote:
> It appears that in Firefox 2.0 it is no longer possible to bring a dependent
> pop-up window to the front by calling the focus() method of the window in
> question.

Do you mean calling focus() on the pop-up, or calling it on its
"parent" (the window on which it is dependent)?

There were indeed changes in Firefox 2 related to the default script
permissions (which are now to not permit them to raise or lower
windows), and I believe there may have also been some that were
related to the "dependent" flag, but I can't find the (recent) bug
discussion at the moment.

Copying to dev-tech-dom, because I think this is both a policy issue
(app) and a mechanism one (DOM).

Mike

DbNetLink

unread,
Nov 14, 2006, 3:38:12 AM11/14/06
to
> Do you mean calling focus() on the pop-up, or calling it on its
> "parent" (the window on which it is dependent)?

The pop-up

On further investigation I have found that this can be overcome by checking
the "Raise/Lower Windows". My personal view is that this should be the
default as it was in 1.5.

This change along with the one that removes the effect of the "modal" flag
has made it much harder to give the right user experience in FF2 for web
applications like ours that use pop-up windows.


"Mike Shaver" <mike....@gmail.com> wrote in message
news:mailman.885.1163450448...@lists.mozilla.org...

rhys...@gmail.com

unread,
Dec 7, 2006, 5:16:23 PM12/7/06
to
Yes, this 'fix' has bitten us pretty badly too - our web app can no
longer use 'dialogs' properly. Will this ever be reverted to the 1.5
defaults?

Rhys

kin...@bigpond.net.au

unread,
Dec 8, 2006, 4:08:30 AM12/8/06
to
Definitely need this fixed. If new windows are permitted to be created
then we need to be able to bring them to focus.

Steve

On Dec 7, 5:16 pm, rhysch...@gmail.com wrote:
> Yes, this 'fix' has bitten us pretty badly too - our web app can no
> longer use 'dialogs' properly. Will this ever be reverted to the 1.5
> defaults?
>
> Rhys
>
> DbNetLink wrote:
> > > Do you mean calling focus() on the pop-up, or calling it on its
> > > "parent" (the window on which it is dependent)?
>
> > The pop-up
>
> > On further investigation I have found that this can be overcome by checking
> > the "Raise/Lower Windows". My personal view is that this should be the
> > default as it was in 1.5.
>
> > This change along with the one that removes the effect of the "modal" flag
> > has made it much harder to give the right user experience in FF2 for web
> > applications like ours that use pop-up windows.
>

> > "Mike Shaver" <mike.sha...@gmail.com> wrote in message
> >news:mailman.885.1163450448...@lists.mozilla.org...

brad...@gmail.com

unread,
Dec 8, 2006, 5:01:44 AM12/8/06
to
My web app suffers as well!!! I see no reason for the popup that was
opened by a user to stay hidden in the background! The default settings
need to be switched in the next update.....

Martijn

unread,
Dec 8, 2006, 5:20:29 AM12/8/06
to brad...@gmail.com, dev-apps...@lists.mozilla.org


Well, I think this will be fixed in the next update, see
https://bugzilla.mozilla.org/show_bug.cgi?id=355482
(without actually switching the default settings back)

Regards,
Martijn

g...@saltmeadow.com

unread,
Dec 9, 2006, 6:37:00 PM12/9/06
to

On Nov 13, 11:16 am, "DbNetLink" <i...@NOTTHISdbnetlink.co.uk> wrote:
> It appears that in Firefox 2.0 it is no longer possible to bring a dependent
> pop-up window to the front by calling the focus() method of the window in
> question.
>

I agree there are sound reasons to create user-controlled popups. And I
disagree with those who claim they significantly affect useability; so
do the blind consultants I employ to test the accessibility of my
designs. And I suspect the current problem with FF2 results from an
attempt to thwart ever sneakier attempts to spawn page-controlled
popups, like with Flash.

So, here's one solution to the hidden popups problem: close your open
popup before you spawn a new one. It takes longer for the new popup to
appear, but it focuses on the popup no matter what your options are set
to in Firefox. And if your js file is external, it's an easy fix.

You can use something like this:

var pup = null; // where 'pup' is your global variable (You can use any
variable name you want)
function closePup() {
if (pup != null && !pup.closed) {
pup.close();
}
}

(If Ggroups strips out the curly brackets and equal signs, well, you
know where they should go.)

Then put 'closePup();' (no quotation marks) as the first line in your
popup function.

But, as long as I brought up the accessibility issue, I need to say be
sure not to use href=void(0) in your links. They DO significantly
affect useability. As long as the href is to a valid URL, the link will
spawn a legible page with or without javascript enabled, and it will
spawn a popup with scripting enabled if you finish the anchor tag with
'return false'.

0 new messages