Closed Bug 1306143 Opened 8 years ago Closed 8 years ago

Devtools Inspector not working correctly if a specific "general.useragent.override" is set

Categories

(DevTools :: Inspector, defect, P1)

49 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1292592

People

(Reporter: stalingraddd, Assigned: jdescottes)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID: 20160922113459 Steps to reproduce: I tested this bug with a new profile on latest stable Firefox. 1) Open about:config 2) Set "general.useragent.override" to "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; SAMSUNG; GT-I8750) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537" 3) Go to any page and open devtools 4) In Inspector tab, try pressing F2/clicking "Edit As HTML" on any element P.S.: You can set "general.useragent.override" to "WebKit/", exactly this string causes the bug, if set to "WebKit" (without '/') all is working as it should be Actual results: Nothing happens, F2 doesn't work, right-click and selecting "Edit As HTML" also Expected results: I should be able to edit any node
Component: Untriaged → Developer Tools: Inspector
This sounds suspiciously similar to bug 1254025, which was fixed in 47. :bgrins, is this a similar issue?
Flags: needinfo?(bgrinstead)
See Also: → 1254025
No it's not similar, i tried to go to http://blog.ethanvizitei.com/2008/06/using-ruby-for-imap-with-gmail.html?m=1 , opened devtools, switched to "Debugger" tab, and i could see all the scripts. The problem is in "Inspector" tab as i described earlier
Inspector bug triage (filter on CLIMBING SHOES).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P1
It is a similar issue, but not identical to Bug 1254025. The part that breaks is: > if (webkit && options.lineWrapping && > getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") > display.lineDiv.style.textRendering = "auto"; getComputedStyle(...) is null Here getComputedStyle() is null because code mirror is hosted in a 'display: none' iframe, and we run into a Firefox-specific issue: bug 548397. (FYI, the webkit variable is defined as var webkit = /WebKit\//.test(userAgent);)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(bgrinstead)
Also note that in https://bugzilla.mozilla.org/show_bug.cgi?id=1292592 we are in the progress switching the CM usage in the inspector to not load a new iframe. If this is a general fix for framed editors we may as well take it though for the benefit of other tools.
See Also: → 1292592
See Also: → 548397
Let's block this specific bug on Bug 1292592, it should fix the issue here. I was about to propose something specific to the html-editor anyway. A more general solution would be to find a way to avoid applying the customUserAgent on devtools. In https://bugzilla.mozilla.org/show_bug.cgi?id=1254025#c24, Brian proposed to change the way we load the Code Mirror iframe to avoid the issue (chrome resource vs data uri) but actually all the window elements of the browser are using the custom useragent. We would need a way to prevent this custom userAgent to be applied on the root devtools iframe. That would be nice to have for devtools-html if we move towards using more 3rd party libraries (quickly checked React for instance, and it does check the userAgent in a few minor spots).
Depends on: 1292592
Just tested after Bug 1292592 landed and it fixes this issue as well.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.