Closed Bug 958510 Opened 6 years ago Closed 5 years ago

tripcase.com doesn't recognize B2G UA as mobile

Categories

(Web Compatibility :: Mobile, defect)

All
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alefteris, Assigned: adamopenweb)

References

()

Details

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

:: Steps To Reproduce

1. Open Firefox OS browser
2. Type tripcase.com 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 https://travel.tripcase.com.

:: 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 http://www.tripcase.com User-Agent:"$FF" -> 302 http://www.tripcase.com/travelsmarter
$ http GET http://www.tripcase.com/travelsmarter User-Agent:"$FF" -> 302 http://travel.tripcase.com

Firefox for Android UA:
$ http GET http://www.tripcase.com User-Agent:"$FFA" -> 200OK

The response body has the following script:

(function(){

        /*\
        |*|
        |*|  :: TripCase Mobile Redirector ::
        |*|
        |*|  Redirects mobile devices to either Tripcase app or web (tdot)
        |*|
        |*|  Support:
        |*|    * android native browser and chrome v.18 and earlier
        |*|
        |*|  Source:
        |*|    * https://developers.google.com/chrome/mobile/docs/intents
        \*/

        var TDOT = 'https://www.tripcase.com/tdot?.r=1',
            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
else:
    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
Status: NEW → ASSIGNED
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 http://travel.tripcase.com/
Status: ASSIGNED → RESOLVED
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.