Closed Bug 958510 Opened 6 years ago Closed 5 years ago doesn't recognize B2G UA as mobile


(Web Compatibility :: Mobile, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: alefteris, Assigned: adamopenweb)




(Whiteboard: [country-all][serversniff][clientsniff][sitewait])

:: Steps To Reproduce

1. Open Firefox OS browser
2. Type in Firefox OS browser address bar

:: Expected Result

We get the mobile site. When typing the web site address on Firefox for Android or iOS Safari we get the mobile site.

:: Actual Result

We get redirected to the desktop site at

:: Additional Information

Software Version: Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0
Device Information: Keon
There's a combination of server-side and client-side detection going on right now.

Desktop-UA & Firefox OS UA:
$ http GET User-Agent:"$FF" -> 302
$ http GET User-Agent:"$FF" -> 302

Firefox for Android UA:
$ http GET User-Agent:"$FFA" -> 200OK

The response body has the following script:


        |*|  :: TripCase Mobile Redirector ::
        |*|  Redirects mobile devices to either Tripcase app or web (tdot)
        |*|  Support:
        |*|    * android native browser and chrome v.18 and earlier
        |*|  Source:
        |*|    *

        var TDOT = '',
            ANDROID_APP = 'tripcase://',
            isAndroid = !!navigator.userAgent.match(/Android/),
            isAndroidChrome = isAndroid ? navigator.userAgent.match(/Chrome\/../) : false,
            androidChromeVersion = isAndroidChrome ? isAndroidChrome[0].slice(-2) : false,
            isNewAndroidChrome = androidChromeVersion ? androidChromeVersion > '18': false;

        function fallback() {
            window.location = TDOT;

        if (!isAndroid || !isAndroidChrome || isNewAndroidChrome) {
            window.location = TDOT;

        } else {
            window.setTimeout(fallback, 100);
            window.location = ANDROID_APP;


We just need to ask that Firefox OS ends up in the same place as Firefox for Android.
Whiteboard: [country-all][serversniff][clientsniff][contactready]
Interesting logic...

If not Android, or not Android Chrome or you are new Android Chrome:
    go to mobile site
    go to mobile site after 100ms
    set window.location to 'tripcase://' to try to open Android app

Not sure why you would try to open the Android app via tripcase:// protocol if !isAndroid, or how isNewAndroidChrome could ever be true?
Contacted via twitter. Waiting for response.
Assignee: nobody → astevenson
Whiteboard: [country-all][serversniff][clientsniff][contactready] → [country-all][serversniff][clientsniff][sitewait]
Received response a couple weeks back, sending a follow up now to see how its going.
Some challenges with flipping the switch due to some dependencies on Webkit libraries. They want to ensure they can provide a great user experience when switching to mobile. They are interested as well about the growth of Firefox on mobile in evaluating next steps.
Tested today, still receiving the desktop site.
Their site has a lot of issues with mixed content.
But at least we are receiving a mobile version because the site switched to responsive design.

It also now redirects to
Closed: 5 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.