Firefox OS User Agent

By  on  

While we consider user agent sniffing a horrible practice on the client side, UA sniffing is done quite a bit on the server side to serve up the appropriate page version of a site, or redirect to, for example, the mobile version of the site.  This can be a dangerous road but most large site with a separate mobile interface do it.  The following is the user agent for Firefox OS:

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

At the moment, many large sites are sniffing for iPhone|Android instead of "Mobile", and thus they are serving their desktop site to Firefox OS devices.  Be aware of the Firefox OS user agent and update your server side logic appropriately!

Note:  Of course the version number within the user agent will update often, so detect "Mobile".

Recent Features

  • By
    Create Namespaced Classes with MooTools

    MooTools has always gotten a bit of grief for not inherently using and standardizing namespaced-based JavaScript classes like the Dojo Toolkit does.  Many developers create their classes as globals which is generally frowned up.  I mostly disagree with that stance, but each to their own.  In any event...

  • By
    5 More HTML5 APIs You Didn’t Know Existed

    The HTML5 revolution has provided us some awesome JavaScript and HTML APIs.  Some are APIs we knew we've needed for years, others are cutting edge mobile and desktop helpers.  Regardless of API strength or purpose, anything to help us better do our job is a...

Incredible Demos

  • By
    Web Notifications API

    Every UI framework has the same set of widgets which have become almost essential to modern sites: modals, tooltips, button varieties, and notifications.  One problem I find is each site having their own widget colors, styles, and more -- users don't get a consistent experience.  Apparently the...

  • By
    Telephone Link Protocol

    We've always been able to create links with protocols other than the usual HTTP, like mailto, skype, irc ,and more;  they're an excellent convenience to visitors.  With mobile phone browsers having become infinitely more usable, we can now extend that convenience to phone numbers: The tel...

Discussion

  1. Matthew Felgate

    Not really worth it; Firefox OS: dead on arrival.

    • The “Most Ridiculous Quote of the Day” is brought to you by Matthew Felgate.

  2. Hm, I’ve read that Firefox OS 1.0 has Gecko 18. Weird…

    • Right; that number will vary but the point of the post is to not simply look for “Android” or “iPhone.

  3. The Firefox way should be used by Apple and Google on this.
    I love the fact that i’s “Mobile”, it makes so much more sense than IPhone, Android, Whatever…

    The content should be, if wanted, delivered by “use-case” and not “device-case”.
    Device-brand detection is like vendor-prefixes, they should be avoided as much as possible.
    Device-type detection is the right way of doing things, props to Mozilla!

  4. A user-agent string has more that one usage and as ua-strings go, this is an abomination.
    The ua-string belongs to the User-Agent and not the OS it happens to be installed on and thus should indicate which OS it is installed on.
    A user-agent string as “a strong values statement” ? (https://bugzilla.mozilla.org/show_bug.cgi?id=777710)
    Words fail…

  5. Why can’t there be a standard on User agents; where we don’t have to use a term like sniff to detect it.
    What is blocking the browsers to have a standard on user agents.

  6. It looks like this useragent isn’t even unique to a Firefox OS device: it could theoretically be transmitted by any Firefox Mobile browser installation with those versions of the components.

    All this means is that this device will be detected by all analytic software as either “desktop device” (if it’s a poor system) or “Generic Mobile Firefox device” if it’s a good one: basically put into the “generic, don’t care” pile.

    Either way, the big data analytics that are so popular nowadays will never organically credit Firefox OS with any market share, because it’s essentially cloaked. Microsoft made a similar mistake with Windows 8 devices cloaking themselves. And if Firefox OS doesn’t appear in the stats, then it effectively doesn’t exist for developers. They can’t target it specifically server-side except as “generic Firefox Mobile device”…

    The whole thing seems to be a case of almost-religious beliefs working against the success of the product.

    If an OS isn’t visible, it will never count, and users will be shortchanged as well.

    (Also, anyone just checking for “Android” and “iPhone” only on server-side really should get a better system).

  7. Thanks for this post. Previously I was trying to detect weather the userAgent was a mobile one or not by checking for each and every mobile browser (Android ,blackberry ,etc) but that was a impossible task due to sheer number of browsers out there. Your advice about checking “Mobile” inside the userAgent was a life saver

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!