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


Author: gerv

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



Version: unspecified
Severity: enhancement
See Also:

bzimport set Reference to bz40919.
bzimport added a subscriber: Unknown Object (MLST).

I am wondering what is the new user-agent ?

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.


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.

Pinged MaxSem on IRC to have a look at it. According to 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

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.


brion added a comment.Oct 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. :)

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

Should be fixed alongside related bug 40513

This is a little weird. It should pick up Firefox in the user agent... I suspect there is something wrong in the varnish config:;a=blob;f=templates/varnish/

However in the process of investigating this I noticed that Fennec doesn't redirect either.
Test here:

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.

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.

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


brion added a comment.Dec 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.Dec 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.Dec 3 2012, 8:52 PM

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

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

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

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 28 2016, 6:13 PM

Add Comment