Wikipedia sends desktop site to Boot2Gecko (Firefox OS)
Closed, ResolvedPublic

Description

Author: gerv

Description:
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


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.mozilla.org/show_bug.cgi?id=799881

bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz40919.
bzimport created this task.Via LegacyOct 10 2012, 10:10 AM
hashar added a comment.Via ConduitOct 10 2012, 10:15 AM

I am wondering what is the new user-agent ?

bzimport added a comment.Via ConduitOct 10 2012, 10:18 AM

gerv wrote:

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

hashar added a comment.Via ConduitOct 10 2012, 10:26 AM

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.

hashar added a comment.Via ConduitOct 10 2012, 10:36 AM

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

bzimport added a comment.Via ConduitOct 10 2012, 1:02 PM

gerv wrote:

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

brion added a comment.Via ConduitOct 10 2012, 8:14 PM

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. :)

Krinkle added a comment.Via ConduitOct 10 2012, 8:29 PM

(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.

Jdlrobson added a comment.Via ConduitOct 11 2012, 3:39 PM

Should be fixed alongside related bug 40513

Jdlrobson added a comment.Via ConduitNov 2 2012, 11:04 PM

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

MaxSem added a comment.Via ConduitNov 26 2012, 10:11 PM

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.

faidon added a comment.Via ConduitNov 28 2012, 5:28 PM

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.

bzimport added a comment.Via ConduitNov 28 2012, 6:49 PM

gerv wrote:

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

brion added a comment.Via ConduitDec 3 2012, 8:31 PM

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.

faidon added a comment.Via ConduitDec 3 2012, 8:49 PM

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.

brion added a comment.Via ConduitDec 3 2012, 8:52 PM

Confirmed fixed -- es.wikipedia.org and sr.wikipedia.org now redirect to mobile view in Boot2Gecko desktop simulator's browser. Thanks!

brion added a comment.Via ConduitDec 3 2012, 8:54 PM

....aaaaand confirmed that iPad still gets desktop site.

Add Comment