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

RESOLVED FIXED
(Needinfo from 2 people)

Status

RESOLVED FIXED
6 years ago
3 years ago

People

(Reporter: lmandel, Assigned: karlcow, NeedInfo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [country-br] [sitewait] [serversniff], URL)

Attachments

(2 attachments)

uol.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.
Blocks: 759987
Component: Gaia → Mobile
Product: Boot2Gecko → Tech Evangelism
Whiteboard: [uaoverride]
Created attachment 699355 [details]
UOL Website with a buttom to access the mobile version
Created attachment 699357 [details]
UOL Website in the mobile version at Firefox OS Simulator
I was testing uol.com.br website at Firefox OS Simulator and it have a button (https://bug826330.bugzilla.mozilla.org/attachment.cgi?id=699355) to change to the mobile version (https://bugzilla.mozilla.org/attachment.cgi?id=699357) of the website.

Is this necessary to contact someone at uol.com.br or this button works for solve this bug? 

I'm asking this because I work at UOL, not at the same area that works with this page specifies, but I can search who is the person that can helps us to fix this problem!
Thank you very much for the offer to help! We would like to have uol.com.br serve the mobile site by default to Firefox for Android and Firefox OS. Your User Agent (UA) detection code needs to be updated to recognize the Firefox for Android and Firefox OS UAs as those for mobile browsers. The UAs are:

Firefox for Android
Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

Firefox OS
Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

Our recommendation is to have your UA detection code recognize the "mobi" token and take its presence to signal that the browser is a mobile browser. Recognizing this token should allow your site to correctly identify a wide variety of mobile browsers.

I have bugs on file for a number of other related domains. Can you help with these as well?
noticias.uol.com.br (bug 826715)
clickjogos.uol.com.br (bug 826949)
pagseguro.uol.com.br (bug 827625)
bol.uol.com.br (bug 827627)
OS: Gonk (Firefox OS) → All
Summary: uol.com.br doesn't recognize B2G UA as mobile → uol.com.br doesn't recognize Fennec and B2G UAs as mobile

Comment 5

6 years ago
I've tested UOL.com.br on a FXOS Geeksphone dev preview and it's working fine.
It's opening the m. version.
(In reply to mkt45 from comment #5)
> I've tested UOL.com.br on a FXOS Geeksphone dev preview and it's working
> fine.
> It's opening the m. version.

Confirmed. I'll file a bug to pull out the override.

Thanks for letting everyone know this is now fixed!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Blocks: 858599
I get desktop content after removing the UA override on my Unagi. 

Jason - How did you test this fix?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Lawrence Mandel [:lmandel] from comment #7)
> I get desktop content after removing the UA override on my Unagi. 
> 
> Jason - How did you test this fix?

I tested this through Phony by switching the UA to Firefox OS UA. Is that not working then?
(In reply to Jason Smith [:jsmith] from comment #8)
> (In reply to Lawrence Mandel [:lmandel] from comment #7)
> > I get desktop content after removing the UA override on my Unagi. 
> > 
> > Jason - How did you test this fix?
> 
> I tested this through Phony by switching the UA to Firefox OS UA. Is that
> not working then?

Phony does not modify navigator.userAgent. If that's in use in this site, it would explain the inconsistency between the Fennec and B2G based testing.
Fennec is now served as mobile site, as tracked by bug 759108.
OS: All → Gonk (Firefox OS)
Summary: uol.com.br doesn't recognize Fennec and B2G UAs as mobile → uol.com.br doesn't recognize B2G UA as mobile
(In reply to Lawrence Mandel [:lmandel] from comment #9)
> (In reply to Jason Smith [:jsmith] from comment #8)
> > (In reply to Lawrence Mandel [:lmandel] from comment #7)
> > > I get desktop content after removing the UA override on my Unagi. 
> > > 
> > > Jason - How did you test this fix?
> > 
> > I tested this through Phony by switching the UA to Firefox OS UA. Is that
> > not working then?
> 
> Phony does not modify navigator.userAgent. If that's in use in this site, it
> would explain the inconsistency between the Fennec and B2G based testing.

I don't follow. Then what's happening when you visit a site with Firefox OS set as the UA in phony?
Flags: needinfo?(mbrubeck)
(In reply to Jason Smith [:jsmith] from comment #11)
> I don't follow. Then what's happening when you visit a site with Firefox OS
> set as the UA in phony?

My understanding is that the UA that is sent as part of the request header is modified. The UA as reported via navigator.userAgent (i.e. used in JS) is not modified.
(In reply to Lawrence Mandel [:lmandel] from comment #12)
> My understanding is that the UA that is sent as part of the request header
> is modified. The UA as reported via navigator.userAgent (i.e. used in JS) is
> not modified.

Yes, I believe that's correct.  Phony just sets the "general.useragent.override" pref, which as far as I know does not change the value of navigator.userAgent.  This is a bug/limitation in Phony.
Flags: needinfo?(mbrubeck)
(Assignee)

Comment 14

6 years ago
Hi Clauber,

Have you made any progress. If possible you could share my contact information with the relevant person at UOL. See below more details about your server configurations.

(In reply to Clauber Stipkovic from comment #3)
> I'm asking this because I work at UOL, not at the same area that works with
> this page specifies, but I can search who is the person that can helps us to
> fix this problem!

I have tested with a ZTE device. Firefox OS gets the desktop version of the Web site.

As you can see the browser is redirected to the mobile version for an iphone.

→ curl -sI -A "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334" http://www.uol.com.br/

HTTP/1.1 302 Found
Date: Wed, 03 Jul 2013 16:11:24 GMT
Server: Apache/2.0.63 (Unix) Ganesh/2.2.0
Location: http://m.uol.com.br/?web
Connection: close
Content-Type: text/html; charset=iso-8859-1


After testing, the minimum string creating the redirect is "iPhone" (case-sensitive iphone doesn't trigger the redirect)

→ curl -sI -A "iPhone" http://www.uol.com.br/

HTTP/1.1 302 Found
Date: Wed, 03 Jul 2013 16:12:14 GMT
Server: Apache/2.0.63 (Unix) Ganesh/2.2.0
Location: http://m.uol.com.br/?web
Connection: close
Content-Type: text/html; charset=iso-8859-1


The strings "Mobile", "mobi", "Mobi" do not trigger any redirect too.


→ curl -sI -A "Mobile" http://www.uol.com.br/

HTTP/1.1 200 OK
Date: Wed, 03 Jul 2013 16:13:53 GMT
Server: Apache
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache, no-store
Pragma: no-cache, no-store
Content-Length: 331303
Set-cookie:  UOL_VIS=A|66.130.24.10|1372868033.692726|; domain=.uol.com.br; path=/; expires=Thu, 04-Jul-2013 06:00:00 GMT
Vary: Accept-Encoding,User-Agent
Expires: Mon, 06 Jan 1990 00:00:01 GMT
Connection: close

Which means it fails for Opera as well as Firefox.

→ curl -sI -A "Opera/9.80 (Android 5.0; Opera Mobi/456) Presto/2.11 Version/12.00" http://www.uol.com.br/

HTTP/1.1 200 OK
Date: Wed, 03 Jul 2013 16:17:07 GMT
Server: Apache
Content-Type: text/html
Cache-Control: no-store
Pragma: no-cache
Content-Length: 331231
Set-cookie:  UOL_VIS=A|66.130.24.10|1372868227.972409|; domain=.uol.com.br; path=/; expires=Thu, 04-Jul-2013 06:00:00 GMT
Vary: Accept-Encoding,User-Agent
Connection: close



The stats in Brazil shows Opera around 15.77% and iPhone at 14.75%, which is equivalent, so "Mobi*" seems to be a good keyword to add to the current user agent sniffing going on.
http://gs.statcounter.com/#mobile_browser-BR-monthly-201206-201306


The web site is also currently triggering redirects on  "Android 2" and "Android 4"

→ curl -sI -A "Android 1" http://www.uol.com.br/

HTTP/1.1 200 OK
Date: Wed, 03 Jul 2013 16:36:36 GMT
Server: Apache
Content-Type: text/html
Cache-Control: no-store
Pragma: no-cache
Content-Length: 330835
Set-cookie:  UOL_VIS=A|66.130.24.10|1372869396.27140|; domain=.uol.com.br; path=/; expires=Thu, 04-Jul-2013 06:00:00 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
(Assignee)

Updated

6 years ago
Whiteboard: [uaoverride] → [uaoverride][uasniffserverside]
(Assignee)

Updated

5 years ago
Whiteboard: [uaoverride][uasniffserverside] → [uaoverride] [country-br] [sitewait] [serversniff]
(Assignee)

Comment 15

5 years ago
Clauber in the case you had not seen the previous comment?
Flags: needinfo?(clauber.halic)
I just talked to someone who created the UA-sniffing tool at UOL, but he's no longer member of that team, but he is engaging someone to take care of this thread. 

Soon we will have a contact to solve this.
(Assignee)

Comment 17

5 years ago
I'm in contact with someone from Globo too. :)

Comment 18

5 years ago
A config update was delivered today. The UA string must contain both "Mobile" and "Firefox" since searching only for "Mobile" would make some tables to be redirected to the mobile version.
Thanks for reporting
(Assignee)

Comment 19

5 years ago
(In reply to dnykn from comment #18)
> A config update was delivered today. 

dnykn, Thanks a lot. Tested and working. 

Not fixed yet for 
* Bug 826715 noticias.uol.com.br
* Bug 827625 pagseguro.uol.com.br
* Bug 827627 bol.uol.com.br

dnykn if could help us reach the right people there, that would be cool. Thanks.
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago5 years ago
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
Blocks: 932040
automated testing confirms fix too :-)
(Assignee)

Comment 21

5 years ago
Confirmed.
Status: RESOLVED → VERIFIED
(Assignee)

Updated

5 years ago
Blocks: 941911
(Assignee)

Updated

5 years ago
No longer blocks: 941911
(Assignee)

Comment 22

5 years ago
Thanks for the efforts Clauber.
Flags: needinfo?(clauber.halic)
:karlcow(In reply to Karl Dubost :karlcow from comment #22)
> Thanks for the efforts Clauber.

Sorry for the delay to help more and thank very much for solve the bug :)
Unfortunately it seems this fix is overly sensitive to the version number in the UA string. Here, requesting uol.com.br with "Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0" UA redirects to the mobile site, while requesting uol.com.br with "Mozilla/5.0 (Mobile; rv:29.0) Gecko/29.0 Firefox/29.0" UA does *not* redirect.

As several shipping or upcoming Firefox OS releases will have version numbers greater than 26, it would be great to get this fixed. Clauber, Daniel: Should I report a new bug?
Flags: needinfo?(danielkono)
Flags: needinfo?(clauber.halic)
(Assignee)

Comment 25

5 years ago
Hmm I just tried with Firefox OS / 32. And I get the mobile site.
(Assignee)

Comment 26

5 years ago
Hmm weird. Check that.
I suspect a load-balancer with configurations not deployed on all servers. We are not hitting the same servers.

Server: Apache/2.0.63 (Unix) Ganesh/2.2.0
Server: marrakesh 1.9.4



***10:27:43***
→ http --print hH http://www.uol.com.br/ User-Agent:"Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0"

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

HTTP/1.1 302 Found
Connection: close
Content-Length: 208
Content-Type: text/html; charset=iso-8859-1
Date: Fri, 04 Jul 2014 01:28:02 GMT
Location: http://m.uol.com.br/?web
Server: Apache/2.0.63 (Unix) Ganesh/2.2.0

***10:28:02***
→ http --print hH http://www.uol.com.br/ User-Agent:"Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0"

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

HTTP/1.1 200 OK
Cache-Control: no-store
Connection: close
Content-Encoding: gzip
Content-Type: text/html
Date: Fri, 04 Jul 2014 01:28:14 GMT
Pragma: no-cache
Server: marrakesh 1.9.4
Transfer-Encoding: chunked
Vary: Accept-Encoding,User-Agent
Re-tested. I'm still seeing desktop content here :-/
(Assignee)

Comment 28

5 years ago
21:32:05 → get www.uol.com.br | grep -i location
21:32:10 → get www.uol.com.br | grep -i location
21:32:14 → get www.uol.com.br | grep -i location
21:32:17 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
21:32:19 → get www.uol.com.br | grep -i location
21:32:21 → get www.uol.com.br | grep -i location
21:32:23 → get www.uol.com.br | grep -i location
21:32:25 → get www.uol.com.br | grep -i location
21:32:27 → get www.uol.com.br | grep -i location
21:32:29 → get www.uol.com.br | grep -i location
21:32:30 → get www.uol.com.br | grep -i location
21:32:32 → get www.uol.com.br | grep -i location
21:32:34 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
21:32:36 → get www.uol.com.br | grep -i location
21:32:38 → get www.uol.com.br | grep -i location
21:32:41 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
21:32:43 → get www.uol.com.br | grep -i location
21:32:45 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
21:32:48 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
21:32:50 → get www.uol.com.br | grep -i location
Location: http://m.uol.com.br/?web
It needs some action from their side, it seems..
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Whiteboard: [uaoverride] [country-br] [sitewait] [serversniff] → [country-br] [contactready] [serversniff]
Status: REOPENED → NEW
(Assignee)

Updated

4 years ago
(Assignee)

Comment 30

4 years ago
So to see if there was a regular pattern, I created a small bash script.

for ((i=1;i<=100;i++));
do
   blah=`http --print hH GET http://www.uol.com.br/ "User-Agent: Mozilla/5.0 (Mobile; rv:30.0) Gecko/30.0 Firefox/30.0" | grep -i location`;
   echo "$i $blah";
   sleep 3;
done


The result displays as 
=======================================
1 Location: http://m.uol.com.br/?web
2 
3 
4 
5 
6 
7 Location: http://m.uol.com.br/?web
8 Location: http://m.uol.com.br/?web
9 
… etc.
=======================================

So on the 100 HTTP requests, 36 went to the mobile site, the rest to the desktop site.
Assignee: nobody → kdubost
Whiteboard: [country-br] [contactready] [serversniff] → [country-br] [sitewait] [serversniff]
still a problem
I only got mobile content now and hope the fix propagated properly..
Status: NEW → RESOLVED
Last Resolved: 5 years ago3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.