Closed Bug 826353 Opened 12 years ago Closed 6 years ago

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

Categories

(Web Compatibility :: Site Reports, defect, P5)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: lmandel, Assigned: karlcow)

References

()

Details

(Whiteboard: [uaoverride] [country-br][clientsniff][sitewait])

itau.com.br serves a desktop site to B2G. Bug 819210 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.
Whiteboard: [uaoverride] → [uaoverride] [country-br]
http://www.itau.com.br/_arquivosestaticos/Itau/defaultTheme/js/itau_home.js?v=2013051600

contains gems like 

else if (window.innerWidth + "x" + window.innerHeight == "688x553") {
		window.top.location = "http://www.itau.com.br/mobile";
        //window.top.location = "http://www.itau.com.br/palm/index.html";
Whiteboard: [uaoverride] [country-br] → [uaoverride] [country-br][clientsniff]
http://www.itau.com.br/atendimento/envie-mensagem/
Assignee: nobody → hsteen
Status: NEW → ASSIGNED
Whiteboard: [uaoverride] [country-br][clientsniff] → [uaoverride] [country-br][clientsniff][contactready]
1st attempt http://twitter.com/MozWebCompat/status/380360060251439104
Whiteboard: [uaoverride] [country-br][clientsniff][contactready] → [uaoverride] [country-br][clientsniff][contactready] [sitewait]
Assignee: hsteen → nobody
Status: ASSIGNED → NEW
I looked a bit more at the source and see two problems that can be fixed.

The first, which Hallvord already identified is that FxOS isn't getting sent to the mobile site due to some restrictive sniffing: https://gist.github.com/miketaylr/7588818

They could add the following else block to send Firefox for Android and Firefox OS browsers to the mobile site:

else if (ua.indexOf("Mobi") != -1) {
  window.top.location = "http://www.itau.com.br/mobile";
}

The second is related to HTML5 video, which makes the assumption that $.browser.firefox doesn't support mp4 (which is basically false at this point on newer platforms): https://gist.github.com/miketaylr/7589637#file-gistfile1-txt-L46-L50

They have a Flash fallback, but that isn't a great solution on mobile these days (or ever?). They would do better to use the HTML5 canPlayType API or just serve multiple <source> elements and let the browser pick the one it can play.
Whiteboard: [uaoverride] [country-br][clientsniff][contactready] [sitewait] → [uaoverride] [country-br][clientsniff][sitewait]
Tweeted again at @itau, this time in Portuguese. :) https://twitter.com/MozWebCompat/status/403636609037238272

Hmm... será que devo traduzir a explicação pro pt-br também?
Hmm... this conversation isn't going anywhere. They keep asking me to install the native app (which doesn't exist for FxOS): http://twatlr.com/thread/403719750263390209
Still an issue (not surprisingly). Leo, would you happen to know someone who works at Itau who can help us get in touch with the developers?
I'll try (again). It's really hard to find bank developers in Brazil, they just don't have any public profiles regarding they jobs, even on local communities. It's also harder to find someone which knows a bank site developer.
Leo,

(In reply to Leonardo da Fonseca Balter from comment #8)
> I'll try (again). It's really hard to find bank developers in Brazil,

Some tips you might try **for a bank**, because indeed you will have hard time finding developers.

* Very often the Web site is developed by an external Web agency, not internally.
* Find the people in charge of marketing or press relations, to explain the issue. They are sometimes more concerned about the customers than the user support contact. (Specifically for a bank)
* Find friends who are clients at the bank and have privileged access to customer support.

Not necessary 100% guarantee but it might help.
tested. Still desktop content.
I've talked to an Itau employee that prefers no to be identified, and his answer (in free translation) was the following:

"we evaluate every browser on every operating system (N versions of linux included), devices and even on TVs, but we need to be sure that our website have full functionality available, so our customers don't get frustrated."

"Firefox OS is such a bet and it's being really well developed, still I cannot guarantee that our website is running on thin platform, so we need to HOMOLOGATE and give its proper attention."

The e-mail was finished by he apologizing himself for not helping effectively, but promising they'll be giving attention to Firefox OS sometime in a near future.
s/HOMOLOGATE/official approval

sorry :/
Blocks: 934126
Daniel, 

Thanks a lot for your efforts. Maybe an additional information that could help or not. :) But you can share it with the developer(s) if not done yet. There is currently a UA override on Firefox OS, which means that when a Firefox OS user access the site, s/he is receiving the site made for Firefox Android. 

We could test again to see if there are very specific issues related to Firefox/Itau, but if it's working on Firefox Android, it will be working on Firefox OS. I can't test now, the site is down and doesn't respond to iOS, Firefox Android and Firefox OS (with UA override off).

Daniel also, do you want to own the bug? :)
Trying through another way. Let's see if we can succeed. 
http://twitter.com/MozWebCompat/status/439291711798247424
Assignee: nobody → kdubost
Status: NEW → ASSIGNED
On April 29, we got the answer:
> Hi @MozWebCompat I think you guys are already talking to the right person: Marcelo Fabeni.

But the issue is still not solved as of today. 

When we fake the UA to be Chrome Mobile 30, we get an intermediate Web page
https://ww70.itau.com.br/M/Institucional/IncentivoAplicativo.aspx
with at the bottom a link to the Web version. Once we click the link at the bottom,
we are being given access to
https://ww70.itau.com.br/M/LoginPF.aspx?unique_id <- long string here

This version is working with Firefox OS. They just need to modify their UA detection to be broader.
On April 29, we got the answer:
> Hi @MozWebCompat I think you guys are already talking to the right person: Marcelo Fabeni.

But the issue is still not solved as of today. 

When we fake the UA to be Chrome Mobile 30, we get an intermediate Web page
https://ww70.itau.com.br/M/Institucional/IncentivoAplicativo.aspx
with at the bottom a link to the Web version. Once we click the link at the bottom,
we are being given access to
https://ww70.itau.com.br/M/LoginPF.aspx?unique_id <- long string here

This version is working with Firefox OS. They just need to modify their UA detection to be broader.
The detection is still done on the client side with some old codes, such as Camino, OmniWeb. 
Also they detect at a point smartphone but not mobile or mobi, this is a bit strange.


/*------------------------------------------Certificados-Browser Detect--------------------------*/

var BrowserDetect = {
    init: function () {
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
        this.version = this.searchVersion(navigator.userAgent)
            || this.searchVersion(navigator.appVersion)
            || "an unknown version";
        this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function (data) {
        for (var i = 0; i < data.length; i++) {
            var dataString = data[i].string;
            var dataProp = data[i].prop;
            this.versionSearchString = data[i].versionSearch || data[i].identity;
            if (dataString) {
                if (dataString.indexOf(data[i].subString) != -1)
                    return data[i].identity;
            }
            else if (dataProp)
                return data[i].identity;
        }
    },
    searchVersion: function (dataString) {
        var index = dataString.indexOf(this.versionSearchString);
        if (index == -1) return;
        return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
    },
    dataBrowser: [
        {
            string: navigator.userAgent,
            subString: "Chrome",
            identity: "Chrome"
        },
        { string: navigator.userAgent,
            subString: "OmniWeb",
            versionSearch: "OmniWeb/",
            identity: "OmniWeb"
        },
        {
            string: navigator.vendor,
            subString: "Apple",
            identity: "Safari",
            versionSearch: "Version"
        },
        {
            prop: window.opera,
            identity: "Opera",
            versionSearch: "Version"
        },
        {
            string: navigator.vendor,
            subString: "iCab",
            identity: "iCab"
        },
        {
            string: navigator.vendor,
            subString: "KDE",
            identity: "Konqueror"
        },
        {
            string: navigator.userAgent,
            subString: "Firefox",
            identity: "Firefox"
        },
        {
            string: navigator.vendor,
            subString: "Camino",
            identity: "Camino"
        },
        {       // for newer Netscapes (6+)
            string: navigator.userAgent,
            subString: "Netscape",
            identity: "Netscape"
        },
        {
            string: navigator.userAgent,
            subString: "MSIE",
            identity: "Explorer",
            versionSearch: "MSIE"
        },
        {
            string: navigator.userAgent,
            subString: "Gecko",
            identity: "Mozilla",
            versionSearch: "rv"
        },
        {       // for older Netscapes (4-)
            string: navigator.userAgent,
            subString: "Mozilla",
            identity: "Netscape",
            versionSearch: "Mozilla"
        }
    ],
    dataOS: [
        {
            string: navigator.platform,
            subString: "Win",
            identity: "Windows"
        },
        {
            string: navigator.platform,
            subString: "Mac",
            identity: "Mac"
        },
        {
            string: navigator.userAgent,
            subString: "iPhone",
            identity: "iPhone/iPod"
        },
        {
            string: navigator.platform,
            subString: "Linux",
            identity: "Linux"
        }
    ]

};




/* ---------------------------------------------- Redimencionamento mobile ---------------------------------- */
function Browser() {
	var agent = navigator.userAgent.toLowerCase();
	this.isUNIX = agent.indexOf( "x11" ) > 0;
	this.isMac = agent.indexOf( "mac" ) > 0;
	this.isOpera = agent.indexOf("opera") > -1;
	this.isIE = agent.indexOf( "msie" ) > 0;
	this.isNS6 = agent.indexOf( "netscape6" ) > 0;
	this.isGecko = agent.indexOf( "gecko" ) > 0;
	this.iphone = agent.indexOf( "iPhone" ) > 0;
	this.ipod = agent.indexOf( "iPod" ) > 0;
	this.isbb = agent.indexOf("blackberry")>0;	
	this.isNS4 = ( document.layers ) ? true : false;
}

function Redireciona() {
    var ua = navigator.userAgent.toLowerCase();
    if (((navigator.appVersion.indexOf("MSIE") > 0) && (navigator.appVersion.indexOf("Windows CE") > 0)) || (navigator.appVersion.indexOf("240x320") > 0)) 
    {
        //var detect = navigator.userAgent.toLowerCase();
        //if (detect.indexOf("smartphone") + 1) {
		if (ua.indexOf("smartphone") + 1) {
            window.top.location = "http://www.itau.com.br/mobile";
        }
        else {
			window.top.location = "http://www.itau.com.br/mobile";
        }
    }
    else if (navigator.userAgent.indexOf("iPhone") != -1 || navigator.userAgent.indexOf("iPod") != -1) 
    {
        ref = document.referrer;
        posicao1 = ref.indexOf("http://itau.mobi/");
        posicao2 = ref.indexOf("https://ww70.itau.com.br/m/");
        if ((posicao1 == -1) && (posicao2 == -1)) {
            window.top.location = "http://www.itau.com.br/mobile";
        } else var browser = new Browser();
    }
    else if (window.innerWidth + "x" + window.innerHeight == "688x553") {
		window.top.location = "http://www.itau.com.br/mobile";
    }
    else if (navigator.userAgent.indexOf("BlackBerry") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
    else if (ua.indexOf("android") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
    else if (ua.indexOf("windows phone") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
    else if (ua.indexOf("iemobile 8") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
    else if (ua.indexOf("nokiae71") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
	else if (ua.indexOf("symbian") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
	else if (ua.indexOf("nokia") != -1) {
        window.top.location = "http://www.itau.com.br/mobile";
    }
    else {
        var browser = new Browser();
    }
}

if(window.location.href.indexOf('/mobile') < 0){
	Redireciona();
}
Priority: -- → P5
Closing as we are not working on Firefox OS anymore.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
(In reply to Mike Taylor [:miketaylr] (62 Regression Engineering Owner) from comment #7)
> Ainda é um problema (não surpreendentemente). Leo, você conheceria alguém
> que trabalha no Itaú e que pode nos ajudar a entrar em contato com os
> desenvolvedores?

Good evening my friend, I need to talk to you about a bug I found on the site
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.