Note that there are some explanatory texts on larger screens.

plurals
  1. PODetecting browser versions on recent mobile devices
    primarykey
    data
    text
    <p>I have a need to differentiate between the native (Android) browser and Google Chrome on more recent Android devices, but keep running into problems, specifically with more recent Samsung devices (the Galaxy S4, Galaxy S4 mini and Galaxy Mega).</p> <p>We have some device detection in-house which analyses the user agent sent from the browser to try and determine which browser is being used. Traditionally to detect Chrome, the code would look for either "Chrome" or "CriOS" within the user agent, normally these are present in the last part of the user agent string (according to the <a href="http://en.wikipedia.org/wiki/User_agent" rel="nofollow noreferrer">Wikipedia article</a> on User agents, this is used to indicate available enhancements).</p> <p>Up until very recently, this worked without issue*.</p> <p>On the latest Samsung Galaxy devices (listed above) running Android 4.2.2, the native browser returns "Chrome" in the user agent string. From some brief reading around the subject, this is because the native browser uses Chromium (I'll admit, I didn't understand the differences between Chromium and Chrome until I read around the subject a bit, more info <a href="http://en.wikipedia.org/wiki/Chromium_%28web_browser%29" rel="nofollow noreferrer">here</a>).</p> <p>This also invalidates the use of Chrome feature detection suggested <a href="https://stackoverflow.com/a/13348618/572585">here</a>.</p> <p>The main issue with this is that we're seeing minor rendering differences between the two browsers, which we'd normally handle with browser specific CSS hacks**, which we're now unable to use.</p> <p>So far, we've only seen this issue on Samsung Galaxy devices, when tested on a Nexus 4 running Android 4.2.2, the native browser does not return Chrome as part of the user agent. It could be that this is a problem very specific to Samsung Galaxy devices running Android 4.2.2, but at this juncture, we don't have a broad enough range of devices to test on.</p> <p>Does anyone know of any way of reliably differentiating between the two browsers without using either of the two methods above?</p> <hr> <p>*that's without any issues that we've noticed or that have been reported to us.</p> <p>**yes, I know using hacks isn't the best way of doing things, but when it's that or re-write large chunks of the code, hacks tend to win out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload