window.onblur not triggered when other program or desktop is focused



12 years ago
9 years ago


(Reporter: koen.vossen, Unassigned)


Firefox Tracking Flags

(Not tracked)



(3 attachments)



12 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20060728 Firefox/
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20060728 Firefox/

The window.onblur event is not triggered when Mozilla put out of focus, for example when clicking on another application or on the desktop. It only seems to happen in OS X, Windows and Linux work fine.

Additionally: window.onblur does trigger when you switch tabs, but then is called three times in a row!

Reproducible: Always

Steps to Reproduce:
1. Create the following document:

<script language="javascript">
function test(){
window.onblur = test;

2. Load this document in your browser.
3. Click the desktop.

Actual Results:  
Nothing happens.

Expected Results:  
A 'test' message box should appear.

Comment 1

12 years ago
Created attachment 242238 [details]
html page that demonstrates the bug

I can confirm that this also happens in 2.0 RC2. I have attached a testcase.

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20061003 Firefox/2.0


12 years ago
Ever confirmed: true

Comment 2

12 years ago
Im changing this to critical because I have gotten FF to crash on me 3 or 4 times by using the test attachment.  Its not consistent, but the crash happens when I close the test window, which occasionally triggers a blur for the now closed window. The popup alert sheet is not attached to any window.  Dismissing it causes a crash.

Also, If you blur the page by clicking on its url or search fields, you actually trigger the event twice.  Not sure if that is a related bug. I'll try to attach a screenshot of the floating alert.
Severity: normal → critical

Comment 3

12 years ago
Created attachment 242282 [details]
showing the alert not attached to any window.

Dismissing the alert causes a crash.

Comment 4

12 years ago
Created attachment 242283 [details]

crashlog from the resulting crash

Comment 5

10 years ago
Window.OnBlur also does not trigger when using mac shortcut keyboard (e.g. F12)
F12 on mac operates the Dashboard widgets
Assignee: nobody → joshmoz
Component: Shell Integration → Widget: Mac
Product: Firefox → Core
QA Contact: shell.integration → mac


10 years ago
Assignee: joshmoz → nobody


9 years ago
Component: Widget: Mac → Widget: Mac
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.