Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Created July 8, 2013 22:03
Show Gist options
  • Save dustintheweb/5952872 to your computer and use it in GitHub Desktop.
Save dustintheweb/5952872 to your computer and use it in GitHub Desktop.
Check if the browser user agent is the stock android browser.
// Stock Android Browser Check >>>>>>>>>>>>>>>>
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1 && ua.indexOf("mobile") && ua.indexOf("chrome")==-1
if(isAndroid) {
// stuff
}
@Jarzka
Copy link

Jarzka commented Nov 28, 2016

Does not work. At least on Samsung GS4 the stock browser also includes Chrome in the user agent string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment