Closed Bug 937477 Opened 8 years ago Closed 8 years ago

dafiti.com.br doesn't recognize B2G UA as mobile

Categories

(Web Compatibility :: Mobile, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: leonardo.balter, Assigned: adamopenweb)

References

()

Details

(Whiteboard: [mobile-compat-form] [country-br] [clientsniff][sitewait])

Site: http://www.dafiti.com.br
dafiti.com.br doesn't recognize B2G UA as mobile

:: Steps To Reproduce

1. The mobile version shows only if I browse from Android, but not FF OS.
2.
3.
...

:: Expected Result

redirecting to the Mobile version

:: Actual Result

no mobile version

:: Additional Information

Software Version: Firefox OS 1.1.0.1
Device Information: LG Fireweb D300. Firefox OS 1.1
Reporter's User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Firefox/28.0
Whiteboard: [mobile-compat-form] → [mobile-compat-form][country-br]
When entering the domain on Firefox for Android we get redirected to a splash screen for downloading an app or go to the mobile. Once the mobile site is chosen, Firefox Android get redirected to the domain http://m.dafiti.com.br/

Firefox for Android

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

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: must-revalidate, max-age=0, s-maxage=0
Content-Encoding: gzip
Content-Length: 23597
Content-Type: text/html
Date: Tue, 19 Nov 2013 19:55:01 GMT
Expires: Tue, 19 Nov 2013 18:55:41 GMT
Pragma: no-cache
Server: nginx
X-Host: www.dafiti.com.br
X-Server: web01-1.dafiticorp.com.br
X-WR-MODIFICATION: Content-Length


Firefox OS 

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

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: must-revalidate, max-age=0, s-maxage=0
Content-Encoding: gzip
Content-Length: 23596
Content-Type: text/html
Date: Tue, 19 Nov 2013 19:55:41 GMT
Expires: Tue, 19 Nov 2013 19:55:01 GMT
Pragma: no-cache
Server: nginx
X-Server: checkout01.dafiticorp.com.br
x-host: www.dafiti.com.br


Hmmm no specific redirection on the HTTP side. There is a client side script for the redirection.

<script sync type="text/javascript">
Mobile_Redirector = function()
{

    var COOKIE_NAME_SITE_VERSION = 'site-version';

    var COOKIE_LIFETIME = 365;
    var REDIRECT_ORIGIN = 'http://www.dafiti.com.br';
    var MOBILE_PATTERN = /iphone|ipod|android/i;
    var MOBILE_EXCLUSIONS = /ipad|android 3|(galaxy )?tab|xoom/i;

    function constructor()
    {
        redirect();
    };

    function GetURLidmobile(sParam)
    {
        var sPageURL = window.location.search.substring(1);
        var sURLVariables = sPageURL.split('&');
        for (var i = 0; i < sURLVariables.length; i++) 
        {
            var sParameterName = sURLVariables[i].split('=');
            if (sParameterName[0] == sParam) 
            {
                return sParameterName[1];
            }
        }
    }

    function GetURLdesktop()
    {
        var sPage = window.location.search.substring(0);
        var indexSearch = sPage.search("&adr")
        return(sPage.substr(0,indexSearch))
    }

    function redirect()
    {
var userAg = navigator.userAgent.match(MOBILE_PATTERN);
if(MOBILE_PATTERN.test(userAg) && $.cookie('cookie_RedirectMobile') == null){
$.cookie('cookie_RedirectMobile', '1', { path: '/', expires: 10 });
if(userAg.toString().search("ndroid") > 0){
window.location.href = "http://www.dafiti.com.br/mobile-android/";
}
if(userAg.toString().search("iPod") >= 0){
window.location = "http://www.dafiti.com.br/mobile-ios/";
}
if(userAg.toString().search("iPhone") >= 0){
window.location = "http://www.dafiti.com.br/mobile-ios/";
}
}else if($.cookie('cookie_RedirectMobile') == "mdafiti"){
window.location = "http://m.dafiti.com.br/";
}
    };
    constructor.apply(this, arguments);
};
new Mobile_Redirector;
</script>
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: Other → ARM
Whiteboard: [mobile-compat-form][country-br] → [mobile-compat-form] [country-br] [clientsniff]
Karl did the analysis already - let's add [contactready]
Whiteboard: [mobile-compat-form] [country-br] [clientsniff] → [mobile-compat-form] [country-br] [clientsniff][contactready]
Email sent.
Assignee: nobody → astevenson
Status: NEW → ASSIGNED
Whiteboard: [mobile-compat-form] [country-br] [clientsniff][contactready] → [mobile-compat-form] [country-br] [clientsniff][sitewait]
Reaching out to:

Lucas Landesman
Chief Marketing Officer Dafiti

https://twitter.com/MozWebCompat/status/441333770646331392
This is fixed. Thanks Adam.
Status: ASSIGNED → RESOLVED
Closed: 8 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.