Closed Bug 439481 Opened 16 years ago Closed 16 years ago

window.document.onblur=function() {window.focus();}; not working

Categories

(Firefox :: General, defect)

2.0 Branch
x86
All
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 53579

People

(Reporter: miker, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

The code:

window.document.onblur=function() {window.focus();};

Should refocus a window whenever it loses focus ... it currently does not. This code is often used by popup windows when the parent window refreshes / redirects after creating the popup (a refreshed parent window gains focus on load when it finishes loading after the popup).

'Allow scripts to Raise or Lower Windows' is checked.

There are bug reports for onblur focus events dating back to the year 2000 ... this really should be fixed once and for all.

Reproducible: Always

Steps to Reproduce:
1.
<html>
<head>
<script language="JavaScript">
        window.document.onblur=function() {window.focus();};
</script>
</head>
<body>
Lorem Ipsum
</body>
</html>

2. Open in FF

3. Click outside the page
Actual Results:  
The page fails to regain focus.

Expected Results:  
The page should gain focus

When the advanced JS option 'Allow scripts to Raise or Lower Windows' is checked windows should be free to focus themselves or other windows without any restrictions (if a user objects they can always close the popup) as many web apps make use of these settings to show a professional UI.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
V.Duplicate
Status: RESOLVED → VERIFIED
Version: unspecified → 2.0 Branch
You need to log in before you can comment on or make changes to this bug.