Closed Bug 937478 Opened 10 years ago Closed 7 years ago recognizes B2G UA as an iPhone


(Web Compatibility :: Mobile, defect, P5)

Gonk (Firefox OS)


(Not tracked)



(Reporter: leonardo.balter, Assigned: karlcow, NeedInfo)




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


(1 file)

Site: recognizes B2G UA as an iPhone

:: Steps To Reproduce

1. open
2. it shows the mobile version
3. And shows you a big popup to install the iPhone app on your device

:: Expected Result

I won't install iphone apps on my Firefox OS device. 

:: Actual Result

The site opens a big popup offering the iPhone app.

:: Additional Information

Software Version: Firefox OS
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]
I'm not having this behavior. 
Firefox OS receives the desktop site.  

Leonardo, could you go to with FireWeb and post the HTTP headers here. :)

Flags: needinfo?(leonardo.balter)
See Also: → 819210
Strange Karl. I get the Mobile site on my device (but the Desktop site when spoofing as FxOS from Desktop). And can confirm the popup to install an app. Let me hook up remote debugging to take a closer look.
Ever confirmed: true
hmm could you remove the, erase the cookies and sees if it's working?
On iPodTouch, there is a redirection to
I have the feeling it is client side.

Let's see. Bingo

<script language="javascript">
			var ua = navigator.userAgent;
			var iOS = /iPhone/i.test(ua) || /iPod/i.test(ua) || /Android/i.test(ua) ;
Just removed the override and now I get the desktop site. So somehow the bare override is affecting this site(?).

The notice to add the site to the iPhone homescreen is hard-coded in the HTML of the /m/ site (which is strange since they're sending Android users there too):

<!-- Modal Webapp -->
<div id="webapp">
	<a class="bt_fechar sprite" href="javascript: void(0)"></a>
	<img class="ico_band" src="imagens/app_icon.jpg" alt="">
	<h1>Instale o atalho em seu iPhone.</h1>
	<p>Aperte ‘<img src="imagens/ico_iphone.png" alt="">’  e selecione “Adicionar à tela  Início”</p>
	<span class="seta sprite"></span>
Whiteboard: [mobile-compat-form][country-br] → [mobile-compat-form][country-br][contactready]
Sorry about the delay, Karl.

Here are the results:

User-Agent:	Mozilla/5.0 (Mobile; LG-D300; rv:18.1)) Gecko/18.1 Firefox/18.1
Accept:	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language:	pt-BR,en-US;q=0.7,en;q=0.3
Accept-Encoding:	gzip, deflate
Connection:	keep-alive
Flags: needinfo?(leonardo.balter)
When accessing with a brazilian Firefox OS phone, the user is receiving a desktop version when iOS or Firefox for Android are receiving the mobile version.

→ http --print hH GET "User-Agent: Mozilla/5.0 (Mob
ile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1"
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
User-Agent:  Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 26170
Content-Type: text/html
Date: Wed, 12 Feb 2014 07:19:39 GMT
ETag: "5ce189ed9c27cf1:0"
Expires: Wed, 12 Feb 2014 07:19:39 GMT
Last-Modified: Wed, 12 Feb 2014 02:48:37 GMT
Pragma: no-cache
Server: Microsoft-IIS/7.5
Vary: Accept-Encoding
X-Powered-By: ASP.NET
X-UA-Compatible: IE=EmulateIE9

We get the desktop version. The redirection is still based on the client side script. Firefox for Android is receiving a working version of the site. 

The script is at the line 37

<script language="javascript">
			var ua = navigator.userAgent;
			var iOS = /iPhone/i.test(ua) || /iPod/i.test(ua) || /Android/i.test(ua) ;
Assignee: nobody → kdubost
To fix this Web site is quite straight forward.
Replace the current client side script with 

<script language="javascript">
   var ua = navigator.userAgent.toLowerCase();
   var ismobile = /mobi/i.test(ua) || /android/i.test(ua);

This will catch a lot more devices.
Attempting another contact.
Whiteboard: [mobile-compat-form][country-br][contactready] → [mobile-compat-form][country-br][sitewait]
Thiago, could you help us find the right person for this bug?
Thanks a lot.
Flags: needinfo?(thiagotf9)
Hi Guys. I'll contact the responsible team.
Flags: needinfo?(thiagotf9)
Thiago, do you have news about this? thanks :)
Flags: needinfo?(thiagotf9)
B2G receives a desktop site now.

I will close it as invalid. 
If someone wants to reach out for getting a mobile site, please open a new bug.
Closed: 7 years ago
Priority: -- → P5
Resolution: --- → INVALID
Cool, I don't work anymore in this company, but if u have problems I can pass to someone there.
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.