Closed Bug 878224 Opened 11 years ago Closed 11 years ago

badoo.com doesn't recognize B2G UA as mobile

Categories

(Web Compatibility :: Site Reports, defect)

ARM
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lmandel, Assigned: karlcow)

References

()

Details

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

badoo.com serves a desktop site to B2G. Bug 823364 added an UA override for this domain. The override should be removed once the domain serves mobile content to B2G. This bug tracks the evangelism for the site to recognize the B2G UA and the removal of the override at that time.
Blocks: badoo.com
Whiteboard: [uaoverride]
badoo.com also serves a desktop site to Fennec.
OS: Gonk (Firefox OS) → All
Summary: badoo.com doesn't recognize B2G UA as mobile → badoo.com doesn't recognize Fennec or B2G UA as mobile
Testing for Firefox for Android.

→ http -v HEAD http://badoo.com/  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 

HEAD / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 302 Moved
Connection: keep-alive
Content-Type: text/html; charset=utf-8
Date: Fri, 26 Jul 2013 19:26:17 GMT
Location: http://mus1.badoo.com/en/landing?c=badoo.webredirect&promo=true
Server: nginx
Set-Cookie: s2=5uuWvBBKyKF.3N8bS3GBhXGHqOTGe4PQ0; path=/; domain=.badoo.com
Set-Cookie: has_secure_session=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.badoo.com

→ http -v HEAD 'http://mus1.badoo.com/en/landing?c=badoo.webredirect&promo=true'  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 
HEAD /en/landing?c=badoo.webredirect&promo=true HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: mus1.badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 501 Not Implemented
Content-Length: 538
Content-Type: text/html; charset=utf-8
Server: xLightweb/2.13.2-B7
Set-Cookie: srv-us=a5205; path=/; domain=.badoo.com


switching to GET

→ http -v GET 'http://mus1.badoo.com/en/landing?c=badoo.webredirect&promo=true'  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 
GET /en/landing?c=badoo.webredirect&promo=true HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: mus1.badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 302 OK
Cache-control: no-cache
Cache-control: no-store
Content-Length: 0
Keep-Alive: timeout=1020
Location: http://mus1.badoo.com/?c=badoo.webredirect&promo=true
Pragma: no-cache
Server: xLightweb/2.13.2-B7
Set-Cookie: srv-us=a5208; path=/; domain=.badoo.com
X-badoo-handler: 10.20.82.8

→ http -v GET 'http://mus1.badoo.com/?c=badoo.webredirect&promo=true'  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 
GET /?c=badoo.webredirect&promo=true HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: mus1.badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 200 OK
Cache-control: no-cache
Cache-control: no-store
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Expires: Thu, 1 Jan 1970 00:00:00 +0000
Keep-Alive: timeout=1020
Pragma: no-cache
Server: xLightweb/2.13.2-B7
Set-Cookie: session=2:200:gJi59huwO7Fd4SZVBfU2l3peCyaXvmW6TcqHzs1R; expires=Mon, 29 Jul 2013 19:28:45 +0000; path=/; domain=.badoo.com
Set-Cookie: udid=73ae4353-e3f2-49f6-b041-a56a1bb4ad92; expires=Sat, 26 Jul 2014 19:28:45 +0000; path=/; domain=.badoo.com
Set-Cookie: srv-us=a5203; path=/; domain=.badoo.com
Set-Cookie: c=1; path=/; domain=.badoo.com; httponly
Set-Cookie: promo=true; expires=Sat, 27 Jul 2013 19:28:45 +0000; path=/; domain=.badoo.com; httponly
Set-Cookie: __utmmobile=0x83ca91262f85d19a; expires=Sun, 26 Jul 2015 19:28:45 +0000; path=/; domain=badoo.com; httponly
Transfer-Encoding: chunked
X-badoo-handler: 10.20.82.3

<?xml version="1.0" encoding="utf-8"?>

etc.

It has a splash screen for downloading the app for Android and proposes to continue to <a href="landing" class="">continue to m.badoo.com</a>, which then leads to 

→ http -v GET 'http://mus1.badoo.com/landing'  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 
GET /landing HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: mus1.badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 302 OK
Cache-control: no-cache
Cache-control: no-store
Content-Length: 0
Keep-Alive: timeout=1020
Location: http://mus1.badoo.com/app/
Pragma: no-cache
Server: xLightweb/2.13.2-B7
Set-Cookie: srv-us=a5202; path=/; domain=.badoo.com
X-badoo-handler: 10.20.82.2

which is then finally the web site.

→ http -v GET 'http://mus1.badoo.com/app/'  User-Agent:'Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 
GET /app/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: mus1.badoo.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 200 OK
Cache-Control: no-transform
Cache-control: max-age=298714298714
Content-Length: 3362
Content-Type: text/html
Expires: Tue, 30 Jul 2013 06:30:22 +0000
Keep-Alive: timeout=1020
Last-modified: Tue, 23 Jul 2013 08:33:13 +0000
Server: xLightweb/2.13.2-B7
Set-Cookie: udid=947d57b6-123a-4b87-9f18-ac5dcfd98ff9; expires=Sat, 26 Jul 2014 19:31:47 +0000; path=/; domain=.badoo.com
Set-Cookie: srv-us=a5205; path=/; domain=.badoo.com
X-badoo-handler: 10.20.82.5

<!doctype html><html class="no-js" lang="en">


The goal of this page being to load a big JS
http://mus1.badoo.com/app/js/packed-en.js
which unminified has 10,216 lines of code
This code has a series of userAgent sniffing too.

line 590 to 593 which is coming from https://github.com/ftlabs/fastclick

FastClick.prototype.deviceIsAndroid = 0 < navigator.userAgent.indexOf("Android");
FastClick.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
FastClick.prototype.deviceIsIOS4 = FastClick.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent);
FastClick.prototype.deviceIsIOSWithBadTarget = FastClick.prototype.deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);


Then line 744, still FastClick

FastClick.notNeeded = function(a) {
    var b;
    if ("undefined" === typeof window.ontouchstart) return !0;
    if (/Chrome\/[0-9]+/.test(navigator.userAgent))
        if (FastClick.prototype.deviceIsAndroid) {
            if ((b = document.querySelector("meta[name=viewport]")) && -1 !== b.content.indexOf("user-scalable=no")) return !0
        } else return !0;
    return "none" === a.style.msTouchAction ? !0 : !1
};


Then line 1616 to 1650, some code which could create breakage in the app. That would be to test.

(function(a) {
    function b(a) {
        var b = this.os = {}, d = this.browser = {}, g = a.match(/WebKit\/([\d.]+)/),
            h = a.match(/(Android)\s+([\d.]+)/),
            f = a.match(/(iPad).*OS\s([\d_]+)/),
            i = !f && a.match(/(iPhone\sOS)\s([\d_]+)/),
            j = a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
            l = j && a.match(/TouchPad/),
            o = a.match(/Kindle\/([\d.]+)/),
            m = a.match(/Silk\/([\d._]+)/),
            k = a.match(/(BlackBerry).*Version\/([\d.]+)/),
            n = a.match(/(RIM\sTablet\sOS)\s([\d.]+)/),
            r = a.match(/PlayBook/),
            p = a.match(/Chrome\/([\d.]+)/) || a.match(/CriOS\/([\d.]+)/),
            t = a.match(/Firefox\/([\d.]+)/);
        if (d.webkit = !! g) d.version = g[1];
        h && (b.android = !0, b.version = h[2]);
        i && (b.ios = b.iphone = !0, b.version = i[2].replace(/_/g, "."));
        f && (b.ios = b.ipad = !0, b.version = f[2].replace(/_/g, "."));
        j && (b.webos = !0, b.version = j[2]);
        l && (b.touchpad = !0);
        k && (b.blackberry = !0, b.version = k[2]);
        n && (b.rimtabletos = !0, b.version = n[2]);
        r && (d.playbook = !0);
        o && (b.kindle = !0, b.version = o[1]);
        m && (d.silk = !0, d.version = m[1]);
        !m && (b.android && a.match(/Kindle Fire/)) && (d.silk = !0);
        p && (d.chrome = !0, d.version = p[1]);
        t && (d.firefox = !0, d.version = t[1]);
        b.tablet = !(!f && !r && !(h && !a.match(/Mobile/) || t && a.match(/Tablet/)));
        b.phone = !(b.tablet || !h && !i && !j && !k && !p && !t)
    }
    b.call(a, navigator.userAgent);
    a.__detect = b
})(Zepto);

And again line 2017 to 2035

(function(a) {
    var b = navigator.userAgent;
    a.os = {};
    a.os.android = b.match(/(Android)\s+([\d.]+)/) || b.match(/Silk-Accelerated/) ? !0 : !1;
    a.os.androidICS = a.os.android && b.match(/(Android)\s4/) ? !0 : !1;
    a.os.ipad = b.match(/(iPad).*OS\s([\d_]+)/) ? !0 : !1;
    a.os.iphone = !a.os.ipad && b.match(/(iPhone\sOS)\s([\d_]+)/) ? !0 : !1;
    a.os.ios = a.os.ipad || a.os.iphone;
    a.os.ios6 = a.os.ios && b.match(/(OS)\s([6])/) ? !0 : !1;
    a.os.playbook = b.match(/PlayBook/) ? !0 : !1;
    a.os.blackberry = a.os.playbook || b.match(/BlackBerry/) ? !0 : !1;
    a.os.blackberry10 = a.os.blackberry &&
        b.match(/Safari\/536/) ? !0 : !1;
    a.os.chrome = b.match(/Chrome/) ? !0 : !1;
    a.os.iosChrome = a.os.ios && b.match(/CriOS/) ? !0 : !1;
    a = a.os;
    b = document.createElement("input");
    b.type = "file";
    a.supportsFileInput = !b.disabled && "file" === b.type
})(Zepto);


and line 2842-2843

    var b, c = navigator.userAgent;
    b = !(!c.match(/(Android)\s+([\d.]+)/) && !c.match(/Silk-Accelerated/)) && !c.match(/(Android)\s4/);
On Firefox OS, 

* with UA override, tested on the device, ZTE receives the mobile site.
* without UA override, tested on the device, ZTE receives the desktop site.


→ http -v GET http://badoo.com/  User-Agent:'Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0' 

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: badoo.com
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0



HTTP/1.1 200 OK
Cache-Control: post-check=0, pre-check=0
Cache-control: private
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Fri, 26 Jul 2013 19:51:08 GMT
Expires: Mon, 26 Jul 1997 05:00:00 GMT
P3P: policyref="http://badoo.com/w3c/p3p.xml", CP="NOI DSP COR NID ADM DEV PSA OUR IND UNI PUR COM NAV INT STA"
Pragma: no-cache
Server: nginx
Set-Cookie: s2=6dXDmmh73_2bZRqqDjVV.FgOOWaSaZF5U; path=/; domain=.badoo.com
Set-Cookie: has_secure_session=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.badoo.com
Set-Cookie: lvnp=0; expires=Thu, 25-Jul-2013 19:51:08 GMT; path=/; domain=.badoo.com
Transfer-Encoding: chunked
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block

<!DOCTYPE html> <html  lang="en" dir="ltr">
Assignee: nobody → kdubost
I'm changing the title as it seems OK for at least the start. There might be specific issues once the user is logged in, but that would have to be tested individually.
Summary: badoo.com doesn't recognize Fennec or B2G UA as mobile → badoo.com doesn't recognize B2G UA as mobile
Contacted through the form http://corpus1.badoo.com/contacts/press/
Whiteboard: [uaoverride] → [uaoverride] [country-all] [sitewait]
Thank you for the bug report I have raised an internal bug and will report back when it is fixed.

Will Lewis
Mobile Web Lead
Last automated test run thinks this is fixed. Is it? :)
It is fixed. I have just checked. I will remove the UA override. Thanks William.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Blocks: 905237
Whiteboard: [uaoverride] [country-all] [sitewait] → [uaoverride] [country-all] [sitewait] [serversniff]
Yes this was fixed and on production as of 02/Aug/13 13:55 (internal reference SRV-4850)
(In reply to Karl Dubost from comment #8)
> It is fixed. I have just checked. I will remove the UA override. Thanks
> William.

Can you confirm that this issue is fixed for Firefox for Android as well?
It is fixed for Firefox OS and Firefox for Android.
Blocks: 907161
Product: Tech Evangelism → Web Compatibility
Component: Mobile → Site Reports
You need to log in before you can comment on or make changes to this bug.