Skip to content

Instantly share code, notes, and snippets.

@bissy
Created October 18, 2017 11:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bissy/108e49118629e398be677999bcdb4484 to your computer and use it in GitHub Desktop.
Save bissy/108e49118629e398be677999bcdb4484 to your computer and use it in GitHub Desktop.
useragentを使ってAndroid標準ブラウザ判定
var ua = navigator.userAgent;
if ((/Android/.test(ua) && /Linux; U;/.test(ua) && !/Chrome/.test(ua)) ||
(/Android/.test(ua) && /Chrome/.test(ua) && /Version/.test(ua)) ||
(/Android/.test(ua) && /Chrome/.test(ua) && /SamsungBrowser/.test(ua))) {
// Android標準ブラウザだったときの処理
$('html').addClass('android-default');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment