joelpurra/emulatetab — Issue #2: Cannot use jQuery on focused <input type="file" /> in Firefox
Author: joelpurra
Created: 2012-02-15 11:56:03+00:00
State: open
Labels: Bug, Confirmed bug, Firefox, Tests fail

One EmulateTab [test fails using Firefox (using 10.0.1)](http://joelpurra.github.com/emulatetab/test/). It is [test #43, Element types: ``](http://joelpurra.github.com/emulatetab/test/?filter=Element%20types%3A%20%3Cinput%20type%3D%22file%22%20%2F%3E).

Try [running issue test code in Firefox](http://jsfiddle.net/joelpurra/bzsv7/).

* Using $(':focus') gives no results in Firefox (tested using 10.0.1), but seems to work in other browsers.
* $(document.activeElement) throws in Firefox (tested using 10.0.1) with "Permission denied to access property 'nodeType'."

I've looked into the problem, but no winning work-around yet.

* Could use an alternate method to find the id (or other unique identifier) of `document.activeElement`, and then feed it into `$(alternate selector)`.
* Could use a `.focusin()` listener and compare `event.target` with `document.activeElement` and perhaps find a way to pin down the file input.