Last modified: 2014-02-12 23:46:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42919, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40919 - Wikipedia sends desktop site to Boot2Gecko (Firefox OS)
Wikipedia sends desktop site to Boot2Gecko (Firefox OS)
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
Feature requests (Other open bugs)
unspecified
All All
: Unprioritized enhancement
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 40513
  Show dependency treegraph
 
Reported: 2012-10-10 10:10 UTC by Gervase Markham
Modified: 2014-02-12 23:46 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gervase Markham 2012-10-10 10:10:06 UTC
If FirefoxOS lies and sends a user agent with "Android" in the title, we get the mobile site. If we remove "Android", we get the desktop site.

Can we encourage you to detect mobile browsers using a more robust algorithm? :-) The recommended method is to use the string "Mobi", which will detect Firefox, Chrome, Android default, Mobile IE and Mobile Opera.

We would very much appreciate this being fixed as soon as possible. At the moment, we may have to send a hacked user agent string to get Wikipedia to work correctly.

This is https://bugzilla.mozilla.org/show_bug.cgi?id=799881

Thanks,

Gerv
Comment 1 Antoine "hashar" Musso (WMF) 2012-10-10 10:15:25 UTC
I am wondering what is the new user-agent ?
Comment 2 Gervase Markham 2012-10-10 10:18:17 UTC
Why do you need to know? Please, please, please don't do mobile browser detection by detecting entire user agents. That might make this mobile browser work, but it will just break for the next one, and the next. 

There is general consensus among mobile browsers that their UAs contain the string "Mobile". (Although for Opera, for historical reasons, it's "Mobi", hence the suggestion to detect "Mobi".) If you have to do user-agent based switching between mobile and desktop sites, then please use this detection method rather than detecting whole user agent strings.

Gerv
Comment 3 Antoine "hashar" Musso (WMF) 2012-10-10 10:26:49 UTC
I am just triaging bugs and though that knowing the user agent would help (even if it is just obvious that it contains the 'Mobi' string.
Comment 4 Antoine "hashar" Musso (WMF) 2012-10-10 10:36:58 UTC
Pinged MaxSem on IRC to have a look at it. According to http://lawrencemandel.com/2012/07/27/decision-made-firefox-os-user-agent-string/ the user agent for Firefox under FirefoxOS is:

Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0

Whereas under Android it would be either:

Mozilla/5.0 (Android; Mobile; rv:14.0) Gecko/14.0 Firefox/14.0
Mozilla/5.0 (Android; Tablet; rv:14.0) Gecko/14.0 Firefox/14.0
Comment 5 Gervase Markham 2012-10-10 13:02:31 UTC
That is correct :-) Although of course the "14.0" changes each release.

BTW, don't rely on that "Tablet" token - it may go away.

Gerv
Comment 6 Brion Vibber 2012-10-10 20:14:21 UTC
Note that if we change the detection to check for 'Mobi' or 'Mobile', it should also blacklist 'iPad' so we keep sending iPads to the full desktop site.

At least until our mobile interface kicks enough ass that people feel comfortable using it on larger screens. :)
Comment 7 Krinkle 2012-10-10 20:29:02 UTC
(In reply to comment #6)
> Note that if we change the detection to check for 'Mobi' or 'Mobile', it should
> also blacklist 'iPad' so we keep sending iPads to the full desktop site.
> 

.. because of "Mobile Safari" in those user agents.
Comment 8 Jon 2012-10-11 15:39:32 UTC
Should be fixed alongside related bug 40513
Comment 9 Jon 2012-11-02 23:04:47 UTC
Mmm
This is a little weird. It should pick up Firefox in the user agent... I suspect there is something wrong in the varnish config:
https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=templates/varnish/mobile-frontend.inc.vcl.erb

However in the process of investigating this I noticed that Fennec doesn't redirect either.
Test here: 
https://gerrit.wikimedia.org/r/31581
Comment 10 Max Semenik 2012-11-26 22:11:25 UTC
Related: bug 40513. Looks like all that is needed for this is to add:

acl mobile browser -i mobi

to /home/wikipedia/conf/squid/mobile_acls.conf

It requires root privileges and not puppetized, so adding Asher.
Comment 11 Faidon Liambotis 2012-11-28 17:28:58 UTC
I'm reluctant to push this during the fundraiser, esp. since we have no FR banners on the mobile site. Brion already found a use case where just "mobi" is unsuitable for this and I'm unsure if there are other such cases too.

I'm not saying no, but let's have more eyes/sign-off from more people for this, at least in this particular time period.
Comment 12 Gervase Markham 2012-11-28 18:49:10 UTC
Mozilla is currently recommending detecting mobile browsers by looking for "Mobi", so we would be very interested in any information which suggests that this is not optimal so we can adjust our advice... Can you pass it on?

Thanks :-)

Gerv
Comment 13 Brion Vibber 2012-12-03 20:31:09 UTC
Over on bug 40513 we've also just discovered that /home/wikipedia/conf/squid/mobile_acls.conf is the secret place this is hiding.

I recommend going ahead and adding a 'mobi' line. We already have exclusions for 'iPad' which is the only known problem case.
Comment 14 Faidon Liambotis 2012-12-03 20:49:36 UTC
This was just deployed. Please confirm that the iPad exceptions work. It'd be also nice to clean up that list for now redundant entries, feel free to letting us know which of them can be removed.
Comment 15 Brion Vibber 2012-12-03 20:52:41 UTC
Confirmed fixed -- es.wikipedia.org and sr.wikipedia.org now redirect to mobile view in Boot2Gecko desktop simulator's browser. Thanks!
Comment 16 Brion Vibber 2012-12-03 20:54:18 UTC
....aaaaand confirmed that iPad still gets desktop site.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links