RESOLVED DUPLICATE of bug 18675 24219
window.onblur and onfocus events don't fire when switching tabs
https://bugs.webkit.org/show_bug.cgi?id=24219
Summary window.onblur and onfocus events don't fire when switching tabs
Jenna Fox
Reported 2009-02-26 20:47:56 PST
Please note, entered as Nightly Build because Safari 4 Public Beta not available on versions list. Issue affects Safari 4 Public Beta, untested on nightlies. While building a long polling chat application, I found myself needing to make use of onblur and onfocus events on the DOMWindow object. I attached handlers using the addEvent method provided by the Mootools framework, which makes use of standard dom methods internally, not the onblur/focus properties themselves. When moving focus away from the window, onblur correctly fires, but when changing to another tab, it does not fire. I also observed that blur and focus events do not fire on inputs within the page as you move away to another tab. Finally, I observed repeatably that while on this other tab, if you finally take focus away from the safari window, it still does not fire onblur. It appears to only fire these events within the active tab when the whole window looses or gains focus. This behavior is inconsistent with Firefox 3.0.6, which treats switching to a new tab as though the 'tab's window' has lost focus and fires these events how I expected. I haven't tested this in any other browsers as of yet, but strongly feel the behavior of Safari 4 is incorrect. I'd like to see it behave like firefox. Treat the tab as the window in this metaphor.
Attachments
Mark Rowe (bdash)
Comment 1 2009-02-26 20:50:58 PST
Alexey Proskuryakov
Comment 2 2009-02-27 01:39:44 PST
*** This bug has been marked as a duplicate of 18675 ***
Note You need to log in before you can comment on or make changes to this bug.