Popup doesn't gain focus after first open

Bug #33840 reported by Malix
16
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Medium
firefox (Suse)
Won't Fix
Medium
firefox (Ubuntu)
Invalid
Medium
Mozilla Bugs
firefox-3.0 (Ubuntu)
Fix Released
Undecided
Unassigned
mozilla-firefox (Debian)
Fix Released
Unknown

Bug Description

When popup is already open it doesn't get focus even if window.focus() is explicitly call. This doesn't happen with Mozilla packaged version. Calling ldd on the two version of the browser indicate that Firefox compiled from Mozilla is linked against

libICE.so.6
libnss3.so
libpangox-1.0.so.0
libsmime3.so
libSM.so.6
libsoftokn3.so
libssl3.so
libXt.so.6

and libstdc++.so.5 instead of libstdc++.so.6

Tags: iso-testing
Revision history for this message
In , Jruderman (jruderman) wrote :

Do you have "Allow scripts to: raise or lower windows" checked in advanced
JavaScript preferences?

Revision history for this message
In , James Bradley (jvlb) wrote :

I have observed this same behavior on Linux, specifically Xandros 3 (Debian
2.6.11). Neither window.focus() nor window.blur() are at all functional.
Preferences are set to enable JavaScript to raise/lower windows.

Revision history for this message
In , Maxfid (maxfid) wrote :

(In reply to comment #1)
> Do you have "Allow scripts to: raise or lower windows" checked in advanced
> JavaScript preferences?

Yes, this option is enabled.
I test this under kde and Gnome and Fluxbox on a Gentoo system. I can confirm
this problem.

Revision history for this message
In , Asa (asa) wrote :

When did this regress?

Revision history for this message
In , James Bradley (jvlb) wrote :

(In reply to comment #4)
> When did this regress?

I first noticed it when I switched from Mozilla to Firefox, at 1.0.4, I believe
it was. I actually added a comment to that effect to another, related bug report
at the time.

Revision history for this message
In , Maxfid (maxfid) wrote :

(In reply to comment #4)
> When did this regress?

I discover this bug now that I'm developing under Linux. I first notice this on
1.0.6, and I can confirm this on 1.0.7 and 1.5b1

Revision history for this message
In , Asa (asa) wrote :

Thanks for the quick feedback. If this was broken in 1.0.x I think it's too late
for fixing in 1.5.

Revision history for this message
In , Maxfid (maxfid) wrote :

(In reply to comment #7)
> Thanks for the quick feedback. If this was broken in 1.0.x I think it's too late
> for fixing in 1.5.

So I hope this will be fixed soon after 1.5 release. This bug is very annoing
for me. Also when I try to view javascript console clicking on web developer
toolbar, if it's open it remains in background and I need to bring it in
foreground manually. For a developer it's not very good.

Revision history for this message
In , Maxfid (maxfid) wrote :

Hi today I test this with Firefox 1.5b2 and The window.focus() now work. Can
some one else confirm this? I use Mozilla Firefox 1.5b2 downloaded from mozilla.org.

Revision history for this message
Malix (malix0) wrote :

When popup is already open it doesn't get focus even if window.focus() is explicitly call. This doesn't happen with Mozilla packaged version. Calling ldd on the two version of the browser indicate that Firefox compiled from Mozilla is linked against

libICE.so.6
libnss3.so
libpangox-1.0.so.0
libsmime3.so
libSM.so.6
libsoftokn3.so
libssl3.so
libXt.so.6

and libstdc++.so.5 instead of libstdc++.so.6

Revision history for this message
In , Bugzilla-gtalbot (bugzilla-gtalbot) wrote :

Resolving as WORKSFORME based on reporter's comment

Revision history for this message
In , James Bradley (jvlb) wrote :

I do not believe the reporter who's comment led to the change of status to resolved was using Linux. The problem is specific to the Linux version of Firefox and has not been resolved on Firefox for Debian 1.5.x.2-2

Revision history for this message
In , Jruderman (jruderman) wrote :

James, the person who created this bug report (Malix) uses Linux and no longer sees the problem, so it's likely that this report will be left as "resolved worksforme". You can create a new bug report using https://bugzilla.mozilla.org/enter_bug.cgi. (Please comment here giving the new bug number if you do.)

Revision history for this message
In , Maxfid (maxfid) wrote :

Hi all,
I switch from Gentoo to Ubuntu and I have to fight with this bug again.
But the problem is not Firefox distributed by Mozilla that work, but is relative
to Firefox packaged by Ubuntu. I noticed that Firefox that come from Mozilla
link different library then the one distributed in Ubuntu. I think the problem
in Debian distribution is the same. I post the bug with the difference between
the library linked on launchpad https://launchpad.net/distros/ubuntu/+source/firefox/+bug/33840 but I get no answer.

Revision history for this message
Malix (malix0) wrote :
Changed in firefox:
assignee: nobody → dfarning
Revision history for this message
Alexandre Otto Strube (surak) wrote :

Mozilla's bugzilla does not even mention debian. I could not find it on debian's bugzilla either. Can you give us some light on this? Does this still happens?

Revision history for this message
Malix (malix0) wrote :

Hi Alexandre James Bradley in the comment #11 on mozilla bugzilla mention the problem on Debian

https://bugzilla.mozilla.org/show_bug.cgi?id=311956#c11

Comment #11 From James Bradley 2006-03-15 22:24 PST [reply]
I do not believe the reporter who's comment led to the change of status to
resolved was using Linux. The problem is specific to the Linux version of
Firefox and has not been resolved on Firefox for Debian 1.5.x.2-2

And of course the bug is still here.

Revision history for this message
In , Maxfid (maxfid) wrote :

I can confirm that the bug is still here. Also on Ubuntu 6.10 (Edgy eft) with Firefox 2.0 beta. I don't understand why no one is caring about this.

Revision history for this message
Malix (malix0) wrote :

I can confirm that this bug is still here. The bug is present on Ubuntu Edgy 6.10 Firefox 2.0 beta. I don't understand why no one is caring about this.

Revision history for this message
In , Maxfid (maxfid) wrote :

I create a test case You can find it here http://www.massimofidanza.it/firefox . Note that this work with Mozilla.org distributed Firefox package. But doesn't work with Ubuntu and I think Gentoo packaged. I'm interested in knowing of other distribution.

Revision history for this message
Malix (malix0) wrote :

I create a testcase. You can find it here

http://www.massimofidanza.it/firefox

Revision history for this message
In , Maxfid (maxfid) wrote :

I like to help fixing this bug. I need some one that help me to set a right breakpoint in the firefox code, so I can debug the code and post the result.

Thanks to everyone that will help.

Revision history for this message
Malix (malix0) wrote :

I like to help fixing this bug. I need some one that help me to set a right
breakpoint in the firefox code, so I can debug the code and post the result.

Thanks to everyone that will help.

Revision history for this message
Malix (malix0) wrote :

Please note that Firefox (upstream) is not affected by this bug. I try other distributions too and this is the result

Debian 3.1 DOESN'T WORK
K/Ubuntu DOESN'T WORK

Firefox dist. by Mozilla.org OK WORK
Fedora Core 4 OK WORK
Suse 10.1 OK WORK
Gentoo OK WORK
Slackware OK WORK

Changed in firefox:
status: Unknown → Unconfirmed
Revision history for this message
Malix (malix0) wrote :

I reported this bug on Debian bug system too. I hope someone will work on it :-)

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391880

Revision history for this message
Caroline Ford (secretlondon) wrote :

So you think this bug was caused by changes made by Debian?

Revision history for this message
Malix (malix0) wrote :

Caroline, yes I think so. I request on IRC to other person to test this and they reported me the bug on Ubuntu and on Debian. I test the bug on other distro and it works. Note I discover this bug first time on Gentoo and reported it on Bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=311956. But now I have no more Gentoo installed and I can't confirm this but someone contacted on IRC said me that the bug now is gone.

magilus (magilus)
Changed in firefox:
assignee: dfarning → nobody
Revision history for this message
magilus (magilus) wrote :

So far this appeard to me with the packaged version from Mozilla.com, too.

What about this problem not being caused by something Firefox related, instead of something Gnome / GTK related?

Changed in mozilla-firefox:
status: Unknown → Unconfirmed
Revision history for this message
In , Andynagai (andynagai) wrote :

(In reply to comment #16)
> I like to help fixing this bug. I need some one that help me to set a right
> breakpoint in the firefox code, so I can debug the code and post the result.
>
> Thanks to everyone that will help.
>

By default firefox 2.0 final will not raise popup windows on subsequent clicks. You must check raise and lower windows in perferences. This is a feature to make unwanted popups less annoying i assume. Seems mozilla is turning into MS, thinking it knows best and changes browser behavior thus breaking pages, forcing devlopers that work on legit sites to recode or change settings on every single browser at my company. Can you guys make this setting to raise and lower popups as default. Theres already a popup blocker in firefox. Dont see any good reason for the non-feature.

Revision history for this message
In , Jruderman (jruderman) wrote :

Andy, your comment is off-topic for this bug but I'll respond anyway.

The pref is intended to do exactly what it says -- prevent sites from raising themselves and making pop-under windows. Both are quite common annoyances. Bug 355482 covers unbreaking sites that use window.focus() to re-focus a legitimate pop-up.

Revision history for this message
In , Jruderman (jruderman) wrote :

Malix, note that the default for the "Allow scripts to: raise or lower windows" pref (now in the Content panel of Preferences) has changed in Firefox 2. You might just need to re-check it or wait for bug 355482 to be fixed.

Revision history for this message
In , Jm-humbert (jm-humbert) wrote :

I can confirm the bug on windows and on linux either!
you cannot get the focus again when another windows was open.

Revision history for this message
magilus (magilus) wrote :

Just tried again

openSuSE 10.2 DOESN'T WORK
Mozilla tarball OK WORK

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
David Planella (dpm) wrote :

I do not quite understand the initial description, but if I interpret it correctly, is bug #41623 a duplicate of this one?

https://bugs.launchpad.net/distros/ubuntu/+source/firefox/+bug/41623

Revision history for this message
Malix (malix0) wrote :

I hope someone is really interested on solving this bug :)

Revision history for this message
In , Krudtaa (krudtaa) wrote :

This is definitely one annoying way of default focus() handling.

And why is this marked as UNCONFIRMED is beyond me?

Using FF 2.0 on XP pro.

Could not understand why this focus() did not work in my new and old webapplication (I could bet this was working in some earlier FF version by default).

You FF developers are doing really great. My favourite browser it is.

But it is a real bummer to:

Not make it backward compatible by default.
   "Raise or lower windows" should definitely be checked by default when
   you install FF.

For this one I think it should also be added that it would probably be a good idea to show a warning in the current window that the application tried to set focus but failed. And then a click on a button should then bring the child window (or whatever) in focus (to make it more intuitive for the end-users that is).
Is it not possible to check wether the child window actually was tried focused because the end-user clicked somewhere, and because the end-user clicked somewhere then the focus() should automagically work.

I can just imagine all the frustrasion on the developers with old apps not working (by default) anymore.

Not to forget all the irritated end-users that suddenly find that something is not working anymore.

Please fix this ASAP and set
"Raise or lower windows" to checked for new installations.

I really hope some developer fixes this. It should not be that hard.

And for those that say that popup windows are horrible.
Well that depends what kind of popup you are talking about.
If you are working with a web-application as an enduser and let say want to pick a date for a form-field, then I would say that it greatly enhances the web-application if popups are used, and it definitely makes the life a lot easier for the enduser and the developer if it is possible to set focus to that child window after window.open, especially important when the enduser select another window after opening the popup, and then click on the button or whatever that triggers the popup.... if the focus() are not used the second time then the enduser will very likely produce a few "words" to the developer of the app.
One fact remains though, this feature ( focus() ) is in use on many sites.

I can think of one zillion cases like the one above......
So IMHO this is important to get right.

Any developer care to take this?

Revision history for this message
In , Jruderman (jruderman) wrote :

Tore, you're looking for bug 355482 (which is fixed in Firefox 2.0.0.1) or something related to it, not this bug. This is a platform-specific bug and does not involve whether/when sites are "allowed" to use window.focus().

David Farning (dfarning)
Changed in firefox:
assignee: nobody → mozillabugs
Revision history for this message
John Vivirito (gnomefreak) wrote :

Is this still and issue for anyone?

Changed in firefox:
status: Unconfirmed → Confirmed
Revision history for this message
magilus (magilus) wrote :

Yes, also happens on Feisty.

Changed in firefox:
status: Confirmed → Rejected
Revision history for this message
In , toer (tore-ericsson) wrote :

I will strongly CONFIRM this bug that prevents from focusing windows in Firefox (Iceweasel) 2.0.0.1 on Debian Etch. The package is installed from Debian Etch.

This bug almost made me crazy some two years ago and I tried to forget it to preserve my health. I have not followed this thread and I am glad to see that it has got SOME attention.

I just want to add that I regularly update my system including Firefox but have NOT SEEN ANY CHANGE as regards this problem. Now I use 2.0.0.1 and the dreadful behavior is always the same: window.focus() does NEVER WORK, at least not for me. Apologies.

P.S. I have "Allow scripts to: raise or lower windows" checked in advanced
JavaScript preferences.

Revision history for this message
In , magilus (magilus) wrote :

I can confirm this issue on Ubuntu Feisty Fawn. It also appears with the Mozilla upstream tarball, so it is no issue of distribution packaging.

Revision history for this message
In , Jm-humbert (jm-humbert) wrote :

now fixed on firefox 2.0 on windows plateform

Revision history for this message
In , toer (tore-ericsson) wrote :

Maybe the bug is specific to certain Debian-based systems? Actually, I have the same behavior with Opera 9.01 which indicates some interaction with my Debian Etch (but the bug is older than Etch, though).

Is there any Debian system that behaves correctly in this respect when other browsers are used than the distribution-default browser (for example, Konqueror)?

(Btw, I have never ever seen this bug with any browser on any Windows system!)

Revision history for this message
In , magilus (magilus) wrote :

No, I also have never seen this bug on a Windows system.

The same bug appears on OpenSuSE 10.2, it may be possible that it is something GTK or Metacity related. It would be interesting how firefox's behavior is running it on KDE or running Opera on KDE.

Revision history for this message
In , toer (tore-ericsson) wrote :

KDE, yes:

I use FF Debian packaged and Opera outside packaged, both in KDE Debian packaged. Nothing else extra, all standard stuff.

Revision history for this message
magilus (magilus) wrote :

I don't know how I was not able not to reproduce it with the upstream tarball.

It also happens with the upstream version.

David Farning (dfarning)
Changed in firefox:
assignee: mozillateam → mozilla-bugs
Revision history for this message
Alexander Sack (asac) wrote :

still see this?

Revision history for this message
Malix (malix0) wrote : Re: [Bug 33840] Re: Popup doesn't gain focus after first open

Yes, the bug is still here. You can try on this link
http://www.massimofidanza.it/firefox

2007/4/25, Alexander Sack <email address hidden>:
>
> still see this?
>
> --
> Popup doesn't gain focus after first open
> https://bugs.launchpad.net/bugs/33840
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
In , Knight-kopernet (knight-kopernet) wrote :

The Debian packaged version of Firefox aka Iceweasel has the same problem. You cannot reuse a once opened window and have focus passed onto it. A code to show this is available here: http://developer.mozilla.org/en/docs/window.open#Examples (openPromoteFFWindow with a reference to window object)

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

Malix, thanks that link was very useful for testing. I can see the second window is hidden in Feisty, but on top in FF2 in gutsy.

Changed in firefox:
status: Confirmed → Fix Released
Changed in firefox:
status: Invalid → Won't Fix
Revision history for this message
In , James Bradley (jvlb) wrote :

Although it has been mentioned in other threads inspired by this issue, I didn't notice it here: the problem does not appear in Seamonkey, nor did it exist in Mozilla suites concurrent with Firefox versions which exhibit it.

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 33840] Re: Popup doesn't gain focus after first open

On Fri, Dec 28, 2007 at 12:13:21PM -0000, Ubuntu QA Tracker wrote:
> ** Tags added: iso-testing
>

aeh ... wontfix for firefox 2 of course ...

 affects ubuntu/firefox
 status wontfix

Thanks,

 - Alexander

Changed in firefox:
status: Fix Released → Won't Fix
Alexander Sack (asac)
Changed in firefox-3.0:
status: New → Fix Released
Revision history for this message
Alexander Sack (asac) wrote : resending commands

firefox-3.0 has a different behaviour (fixed)

 affects ubuntu/firefox-3.0
 status fixreleased

firefox 2 won't receive any fixes anymore

 affects ubuntu/firefox
 status invalid

 - Alexander

Changed in firefox:
status: Won't Fix → Invalid
Revision history for this message
In , Goatfarm (goatfarm) wrote :

I definitely CONFIRM this on Windows XP, on MAC and on Windows Vista.

Revision history for this message
In , Georgemathew2 (georgemathew2) wrote :

I am working in firefox 3.5.5 on win XP. I have some problems with focusing to a textbox after validating the field for a valid email address

Changed in mozilla-firefox (Debian):
status: New → Fix Released
Revision history for this message
In , Bolterbugz (bolterbugz) wrote :

Is anyone seeing window.focus ever fail on Linux these days? (Wondering if this is causing bug 525175)

Revision history for this message
In , James Bradley (jvlb) wrote :

The page which first brought this to my attention appears to work properly since 3.0.

Revision history for this message
In , magilus (magilus) wrote :

works properly on Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.6) Gecko/20100107 Fedora/3.5.6-1.fc12 Firefox/3.5.6

Revision history for this message
In , James Bradley (jvlb) wrote :

I believe the bug only affected Debian variants.

Revision history for this message
In , Bolterbugz (bolterbugz) wrote :

Closing WFM based on comments. I suspect this could be a Linux window manager issue; please reopen and report distro and window manager info if it recurs.

Changed in firefox:
status: New → Invalid
Changed in firefox:
importance: Unknown → Medium
Changed in firefox (Suse):
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.