RESOLVED FIXED3779
gmail website steals tab focus
https://bugs.webkit.org/show_bug.cgi?id=3779
Summary gmail website steals tab focus
Chris L. Mason
Reported 2005-06-30 14:09:14 PDT
If you start loading the gmail site in one tab, then (because if often takes awhile) you open a new tab and start doing something else, when the gmail site loads to the inbox, it switches the current tab in the user interface back to the tab gmail was loaded in! What makes this more annoying is that often I am in a new tab, typing a new url, and the old tab with gmail pops back into "focus" just as I am hitting enter, resulting in the new site being loaded in the gmail tab, and me losing my gmail inbox! I haven't encoutered any other site that manages to change the tab focus in Safari. I'm not sure how it is doing so, maybe some unique bit of javascript? In any event, I think this behaviour should never be allowed. I left gmail back in its own tab for a reason, I'll come back to it when I'm good and ready! :) Note this also happens in Safari 1.3 and 1.2 and probably further back as well.
Attachments
simple testcase (625 bytes, text/html)
2006-05-31 01:56 PDT, Jesse Ruderman
no flags
Joost de Valk (AlthA)
Comment 1 2005-07-01 11:46:17 PDT
very, very weird bug... Should be fixed, before any other sites figure out how to do it.
Chris L. Mason
Comment 2 2005-08-20 14:34:59 PDT
Blah, this bugzilla won't let me change my email address. :(
Darin Adler
Comment 3 2005-09-04 13:14:33 PDT
If you call window.focus(), then your window and tab come to the front. That's working as designed.
Chris L. Mason
Comment 4 2005-09-04 16:45:21 PDT
Because of the behaviour I described, I think this should not be permitted by default. If not, at least can an option be provided to turn this off (like with the popup blocker)? I believe that most people would not want windows and/or tabs popping up of their own accord.
mitz
Comment 5 2005-09-05 06:48:11 PDT
Firefox behaves differently. It never switches to the Gmail tab, but it does bring the window containing that tab to the front (which is rather pointless if it's not the active tab).
Jesse Ruderman
Comment 6 2006-05-31 01:56:01 PDT
Hyatt agrees this is a bug. It's similar to the fixed Gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=300453. (Side note: WebKit gets this right for textboxes, while Gecko doesn't; see https://bugzilla.mozilla.org/show_bug.cgi?id=307933.)
Jesse Ruderman
Comment 7 2006-05-31 01:56:58 PDT
Created attachment 8617 [details] simple testcase
Jesse Ruderman
Comment 8 2006-05-31 02:00:15 PDT
Err... that testcase demonstrates the bug when loaded from file:///, but it hits a same-origin security error when loaded from Bugzilla. I guess WebKit doesn't treat data: URLs the same way as Gecko. Odd that it works from file:/// then.
Jesse Ruderman
Comment 9 2006-05-31 02:03:04 PDT
There's also the question of whether web sites should be allowed to steal focus at all, but since that's not what Gmail is trying to do, I don't think that's on-topic for this bug.
Dave Hyatt
Comment 10 2006-05-31 14:31:45 PDT
Fixed.
Chris L. Mason
Comment 11 2006-05-31 14:55:04 PDT
Thanks!
Note You need to log in before you can comment on or make changes to this bug.