Page MenuHomePhabricator

jquery.client should support detecting Firefox Mobile
Open, LowPublic

Description

A "Request desktop site" option exists in Chrome and Firefox on Android, and maybe in some other browsers too.

I believe what that option affects is just a user-agent string, and does not change other behaviors of the browser. However (for example in Firefox), with "Request desktop site" on, VisualEditor works happily, while with that option off, VisualEditor refuses to load.

We should check whether VE actually works in these browsers, and have it whitelisted or blacklisted, regardless of whether that option is on or off.


Version: 1.24rc
Severity: normal

Details

Reference
bz65255

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz65255.
bzimport added a subscriber: Unknown Object (MLST).

Do you mean "make jquery.client detect for Firefox mobile"? If so, that's a very different bug to how you've written this one. :-)

(In reply to James Forrester from comment #1)

Do you mean "make jquery.client detect for Firefox mobile"? If so, that's a
very different bug to how you've written this one. :-)

Hmm? so it's already special cased in jquery.client for Chrome mobile, so there's no such issue in Chrome, without any change in VE side (I haven't really tested)?

(In reply to Liangent from comment #2)

(In reply to James Forrester from comment #1)
> Do you mean "make jquery.client detect for Firefox mobile"? If so, that's a
> very different bug to how you've written this one. :-)

Hmm? so it's already special cased in jquery.client for Chrome mobile, so
there's no such issue in Chrome, without any change in VE side (I haven't
really tested)?

I don't know. Your bug report seems to suggest that Firefox Mobile is getting detected as a failing browser, and telling Firefox Mobile to pretend to be Firefox makes it work fine. That's a sign that it's failing jquery.client's test cases.

Do you have an example UA string? https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference suggests that it should be putting out "Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0".

By having Firefox hit my own webserver, I caught UA below. Not sure whether it can be different from the one returned by navigator.userAgent.

"Request desktop site" off:

Mozilla/5.0 (Android; Mobile; rv:29.0) Gecko/29.0 Firefox/29.0

JSON.stringify($.client.profile({userAgent:'Mozilla/5.0 (Android; Mobile; rv:29.0) Gecko/29.0 Firefox/29.0',platform:''}))
"{"name":"android","layout":"gecko","layoutVersion":29,"platform":"unknown","version":"mobile","versionBase":"0","versionNumber":0}"

"Request desktop site" on:

Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0

JSON.stringify($.client.profile({userAgent:'Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0',platform:''}))
"{"name":"firefox","layout":"gecko","layoutVersion":20100101,"platform":"unknown","version":"29.0","versionBase":"29","versionNumber":29}"

It seems there're two places where UA matters, summarized below:

Browser | Option | profile().name | profile().version | Tab shown | Warning shown

Firefox | On | android | mobile | No | N/A
Firefox | Off | firefox | 29.0 | Yes | No
Chrome | On | android | 4.4.2 | Yes | Yes
Chrome | Off | chrome | 34.0.1847.114 | Yes | No

Firefox with the option on is being detected as browser "android" version "mobile" is the most problematic thing here, because it completely disables VE.

So it's a jquery.client issue: for Chrome and Firefox on Android, profile().name should always be "firefox" or "chrome" respectively, with .version set correctly, no matter how user configures the browser.

Currently in Chrome, profile().platform is "linux". Maybe we can use "android" there to signify the browser is running on Android.

Jdlrobson moved this task from Needs triage to Triaged on the Mobile board.Jan 21 2015, 12:02 AM
Krinkle added a comment.EditedMar 11 2015, 11:46 PM

If I understand correctly:

  • When users of Firefox Mobile use "Request desktop site", it uses a user agent header jQuery Client recognises as desktop Firefox. And VE supports that. And that browser supports VE. All is good.
  • When users of Firefox Mobile use the default mode, it uses a user agent header jQuery Client doesn't yet recognise properly (version=mobile). VE doesn't whitelist that. But it seems otherwise that browser would support VE.

I'm not sure that working around the intentionally faked user-agent header will be feasible. It would leave us in a hard to maintain state.

I'd recommend, instead:

  • jQuery Client should detect the name and version of Firefox Mobile properly.
  • VisualEditor whitelists Firefox Mobile (from that version and up).
Krinkle renamed this task from jquery.client shouldn't be fooled by "Request desktop site" option in mobile browsers to jquery.client should support detecting Firefox Mobile.Oct 9 2017, 10:18 PM
Krinkle removed a subscriber: wikibugs-l-list.
Krinkle removed a subscriber: Krinkle.