0

I have a problem with a site not detecting a stock S5 browser as mobile. I don't own a galaxy S5 so I asked the person who found this issue to send me the complete user agent string, this is what I got:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.94 Safari/537.36

does the S5 browser really not identify itself as running on an android device? Might this be the result of some custom setting (which I'm told never happened)? How else can I identify the S5 browser as being a mobile device?

5
  • 1
    I have never seen an Android useragentstring with Linux x86_64 in it. That looks more like a desktop useragentstring to me. Jul 7, 2014 at 12:34
  • Perhaps it was a concious choice? Maybe Samsung are trying to get a richer web experience for their users by not saying that it's a mobile device? Shouldn't sites be coding against screen size / viewport and browser functionality instead of OS anyway? Jul 7, 2014 at 13:32
  • @indivisible sometimes content depends on device (ads, for example) Jul 7, 2014 at 16:00
  • You can't trust any UA from Samsung. Just try pointing your Samsung TV's browser to one of those sites,and see what kind of garbage turns up. (Usually "Safari" related.)
    – not2qubit
    Jul 10, 2014 at 0:58
  • It is normal to see "Safari" somewhere in the UAS Jul 13, 2014 at 20:27

3 Answers 3

2
+25

After some poking around it would appear that in this case the browser is not identifying itself as running on an Android device. I put the useragentstring you supplied into useragentstring.com and in the operating system details field it tells me;

Operating System: 
Linux
running on a Intel CPU
running on a 64 bit processor

If I enter the useragentstring for the stock browser on my HTC One I get:

Operating System: 
Android
version 4.4.2

and on Chrome mobile browser I also get:

Operating System: 
Android
version 4.4.2

I would suggest asking the user of the device to clear data/cache and see if the problem persists. I can't imagine Samsung would have their browser setup like this by default.

EDIT: Also just found here that the useragentstring for the S4 should be something along the lines of;

Mozilla/5.0 (Linux; U; Android 4.2.2; nl-nl; GT-I9505 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

which is nothing like what you posted. If anyone on AE with an S5 could post their useragentstring (can get it from here) that would be useful, unless you know anyone else with an S5 where you could check against.

EDIT2: FYI, the useragentstring for my stock browser on my HTC is;

Mozilla/5.0 (Linux; U; Android 4.4.2; en-gb; HTC_One Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

and for Chrome;

Mozilla/5.0 (Lunix; U; Android 4.4.2; HTC One Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36

4
  • Yes I have similar findings, no device I tried failed to identify itself as some verion of Android Jul 7, 2014 at 16:01
  • I asked on a forum about the uas for the S5 and someone replied with the same as what you posted in your original Q. Bizarre Jul 7, 2014 at 16:22
  • Ignore my last comment. The forum I posted in linked back to here. Real life redirect loop! Have you tried clearing app data/cache for the browser? Jul 10, 2014 at 22:37
  • developer.chrome.com/multidevice/user-agent Some info on distinguishing between Android Chromium based WebWiew and Chrome for Android Feb 9, 2015 at 16:53
2

I have just tried on my Galaxy S5 and I got following useragent

Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG-SM-G900A Build/KOT49H) AppleWebKit/537.36 
(KHTML, like Gecko) Version/1.6 Chrome/28.0.1500.94 Mobile Safari/537.36
2
  • In order to target s5 native browser, which is on AT&T phones (and not s6), here is my javascript string: var isAndroid = navigator.userAgent.toLowerCase().match(/samsung/) != null && navigator.userAgent.toLowerCase().match(/g900a/) != null;
    – bdanin
    Oct 2, 2015 at 13:42
  • there are actually 3 or so sub-models of the g900 (a, s, v, maybe more), also – Chrome and native browsers have nearly identical user-agent strings, so this doesn't hold up too well ... the only difference I found was the en-us string in the native S5 browser ... here is the new UA string I used: var isAndroid = navigator.userAgent.toLowerCase().match(/samsung/) != null && navigator.userAgent.toLowerCase().match(/g900/) != null && navigator.userAgent.toLowerCase().match(/en-us/) != null; if you can avoid having to use this approach, avoid it at all costs
    – bdanin
    Oct 2, 2015 at 15:35
0

I got

Mozilla/5.0 (Linux; Android 4.4.2; SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 ACHEETAHI/2100050050

using the CM browser v5.0.50

A cross-comparison might help you debug.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .