Open Bug 1474641 Opened 7 years ago Updated 3 years ago

JavaScript focus() method does not work when developer tools are displayed

Categories

(DevTools :: General, defect, P3)

63 Branch
Unspecified
Windows
defect

Tracking

(firefox61 affected, firefox62 affected, firefox63 affected)

Tracking Status
firefox61 --- affected
firefox62 --- affected
firefox63 --- affected

People

(Reporter: fady.potter, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180705151535 Steps to reproduce: Open a page with the focus method in a tab with developer tools. Example for page code : <!DOCTYPE html> <html> <body> <input id="inp"></input> <script> window.onload=function(){ document.getElementById("inp").focus(); } </script> </body> </html> Actual results: The lower command line gets the focus so the code gets override. Expected results: The input should get the focus as when the developer tools are not displayed. The user code should get the priority.
User Agent:   Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 Build ID: 20180713100116 I manage to reproduce this issue on Windows 7 x64 and Windows 10 x64 with Firefox Nightly 63.0a1 (2018-07-13) (64-bit).
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout
Ever confirmed: true
OS: Unspecified → Windows
Product: Firefox → Core
Version: 62 Branch → 63 Branch
Feels more an issue of devtools, although I have no idea how devtools can avoid doing that... Maybe it can somehow query whether the page has acquired the focus before grabbing it.
Component: Layout → General
Product: Core → DevTools
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.