bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Website JS.focus() steals focus from outside of tab




8 years ago
8 years ago


(Reporter: Kurt Swanson, Unassigned)


Firefox Tracking Flags

(Not tracked)



(2 attachments)



8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100824 Firefox/3.6.9 (.NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100824 Firefox/3.6.9 (.NET CLR 2.0.50727)

A website can craft simple JavaScript to (mildly) prevent the user from leaving the site via the location bar or search bar, as well as various sidebars.  This is done by simply attaching a timeout with small millisecond value to request focus.  It does not, however, block other ways out of the site (navigation buttons, other tab selection, etc.).

Reproducible: Always

Steps to Reproduce:
1. Save the two attached files
2. Load frameset.html
3. Attempt to type in location bar, search bar, and sidebars
Actual Results:  
Focus changes immediately revert to form field

Expected Results:  
Ability to type into location/search/side bars

Was not an issue prior to 3.0 (yes, I've waited a long time to report this).  Not a problem in competitor's browsers (as if that was relevant).

Comment 1

8 years ago
Created attachment 475676 [details]
Load this one, but requires the other

Comment 2

8 years ago
Created attachment 475677 [details]
Referenced by the first--load the other one

Comment 3

8 years ago
Note this is similar to bug 125282 in nature, but does not involve the period of page loading exclusively.

Comment 4

8 years ago
Rrrr... filenames of attachments not retained...

To reproduce you need to save the first attachment (which I call frameset.html) and the second (as frame.html) and load the first.


8 years ago
OS: Windows XP → All
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.