Closed Bug 502735 Opened 15 years ago Closed 12 years ago

Facebook chat steals focus

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: khuey, Unassigned)

References

()

Details

(Keywords: regression)

Facebook chat steals focus from the current window in Firefox.

1. Open two Firefox Windows
2. In one, open Facebook chat.
3. Browse in the other window.

Observed behavior: When someone sends you a Facebook chat message, the window with Facebook chat will steal focus from the window you are browsing in.

Expected behavior (prior as well): Facebook chat waits gracefully in the background till I switch to it.
If I wasn't specific enough, this is a regression from 3.0
Keywords: regression
Is this a problem in recent builds?
I can confirm this works when using Facebook chat in one tab and Gmail chat in another tab.  If a message comes in from an open chat in one tab, I am unable to type any text in the Gmail Chat in a different tab, unless I go to the tab Facebook is in, click on the text box there and then switch back.  

This only started happening for me with 3.5
This occurs on Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090704 Minefield/3.6a1pre (.NET CLR 3.5.30729) which is the newest I have.  For me at least, it doesn't just take keyboard input away, the window with Facebook chat in it actually comes to the front.
I have the same issue, tho firefox 3.5 locks up and i can not even close the window without a ctr+alt+del command. only happend since i upgraded to 3.5
Is this a flash or other plugin? A reduced testcase would be nice here. Or at least if we could find out what code is being called which changes the focus.
I'm getting intensely annoyed by this bug and am happy to help with diagnosing it at a high level. As well as bringing a Facebook window to the front of the stack, I also see problems if I have Facebook in another tab within the same window. Most often, I am typing into a textarea in one tab, when the Facebook message arrives, the input focus changes. I think it changes to the general FF window as my continued typing often causes me to return to a previous page (thereby losing what I had entered into the textarea!).

I'm running 3.5 and seeing the bug but also had it in the version previous to this (I always accept updates so it would be the previous release).

My plugins are:
ABP
Firebug
Google Toolbar
gTranslate
IE Tab
LogMeIn
XMarks
I've just had a play and I can reproduce this in safe-mode in 3.5 . 

If I have two windows open, a single tab in each window, one window with Facebook then an incoming Facebook message brings that window to the front, even if it was previously at the back. 

If I have a single window with two tabs, one behind with Facebook and one in front with me typing into a textarea, an incoming message steals the input focus from my textarea but the Facebook tab stays behind.
I've 'cured' this bug for myself by unticking the "Play Sound for New Messages" option in Facebook chat. This seems reliable for me, it stops it in all situations I can think of and turning the option back on leads to the bug exhibiting itself again.

A friend, also with FF 3.5, can't reproduce the bug with or without the "Play Sound for New Messages" option turned on.
(In reply to comment #7)
> I'm getting intensely annoyed by this bug and am happy to help with diagnosing
> it at a high level.

I'm mainly interested at this point is what code is being used to focus and bring the chat message to the front.

Also, if the chat window is a Flash application or not.
(In reply to comment #10)
> (In reply to comment #7)
> > I'm getting intensely annoyed by this bug and am happy to help with diagnosing
> > it at a high level.
> 
> I'm mainly interested at this point is what code is being used to focus and
> bring the chat message to the front.
> 
> Also, if the chat window is a Flash application or not.

I don't believe there's any Flash involved, I assume it's just Javascript. The chat function of Facebook operates from a bar that appears at the bottom of every page.

I don't know how to work out what code is causing the problem, I'm technical so if you give me guidance I can probably work it out. I don't think Facebook is bringing its Window to the front on purpose, especially since turning the sound off seems to stop it happening.
(In reply to comment #13)
> *** Bug 501874 has been marked as a duplicate of this bug. ***

Why is it that my bug was marked as a duplicate, yet it was posted before yours?  Wouldn't that make yours the duplicate?
Same problem in Windows 7.  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090722 Minefield/3.6a1pre (.NET CLR 3.5.30729)

Very annoying
Do you have the 'raise or lower windows' option set?

Firefox Options -> Content tab -> Advanced button (next to Enable Javascript) -> check box "Raise or Lower Windows"
An easy way to diagnose if this is a Flash goblin at work is when you lose focus, try hitting Ctrl+T to make a new tab.

Classically if you are focused in Flash, Ctrl+T will not work, and Flash is known to have cross-tab hilarity, especially if using AS2.

I don't think the Flash is the input field... but that sound they play could be in Flash and could potentially hate babies.
Wow, awesome crew working on Firefox. After the update today the problem seems to be resolved. I have tried numerous times to replicate it with no success. 

Now only if you could get Favicon's to work without having to install Java.
Ok, I spoke too soon. I was not doing it for 20 minutes, I post on here and less than 5 minutes later it happens again.

"Raise or Lower Windows" is off, and Ctrl+T still works.
Problem still exists for me as well.
I will try to reproduce tonight... Ctrl+T still working suggests that this is not Flash taking focus... but the fact that having the sound off seems to solve the bug is curious.

I will see if disabling Flash add-on entirely helps.
Turning off the sound notifications in facebook chat disables the bug.

Perhaps there's some code somewhere that's returning focus to that active window when that sound function is called.  Give it a shot.
I can't reproduce this anymore.  If nobody else can I'll close it in a bit as WFM.
I can still reproduce it in 3.5.4 by setting "Play Sound for New Messages" in Facebook Chat's options and then using the second case in https://bugzilla.mozilla.org/show_bug.cgi?id=502735#c8

The first case makes the screen flicker but no longer brings the Facebook Chat window to the top of the stack.
It's been happening to people using Javascript apps like Mibbit (web-based IRC
interface), as well. I know it was happening yesterday to some people. I can't
test it in Facebook chat right now, but it just happened using Mibbit.

Basically, calling up the sound makes it so you can't keep typing in another tab until you either click outside of the box you're trying to type in or go to the tab with the chat in it.

It's something to do with the sound, for sure.
Confirmed. When you disable the sound option, it works just fine. Sound related 100% positive.
I should also note that this doesn't happen with either Facebook or Mibbit if you're using IE, so it's most likely a FF-specific problem. (I don't know about other browsers.)
I still have this bug both on myspace (very slow drawing of all the graphics when I try to send some posts or send emails) and on facebook, which is actually a nightmare!!! I noticed that not only the chat windows slow down and hang the computer, but also any other window opened by the site, such as the notification window. I've not still tried to remove the sound of the new messages but I'll try it soon. Anyway I noticed that I had similar problems (but not exactly the same) even with IE. Opera is the best one, because it has less problem, but it seems it's a problem of Java or Javascripts most of all, because facebook and myspace heavily use that. Anyway I hope Firefox will solve this problem, because it's my favourite browser! 
Happy new year everybody
You can also see this occur when logging into multiple PCs using LogMeIn, but I'm not sure if it's exactly the same bug.

To reproduce, have the logmein firefox plugin installed. Then login to logmein website and select several computers to remote control at once, opening in different tabs. On both of them wait for the logmein PC login screens. On one, enter the username and password and then quickly switch to the other PC login screen. Remain there until you can no longer type in the login field.

To resolve I have to give the address bar focus and then return to the login fields.
Travis, can you still reproduce with logmein ?
Whiteboard: [closeme 2012-05-25]
Resolved per whiteboard
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2012-05-25]
This issue is still exists on UX build 21.0a1 2013-01-06.
(In reply to unique.ek from comment #33)
> This issue is still exists on UX build 21.0a1 2013-01-06.

I thought this was about "Facebook Messenger For Firefox" so you can ignore what i have wrote earlier.
You need to log in before you can comment on or make changes to this bug.