LoginSignup
8
9

More than 5 years have passed since last update.

[javascript]useragentを使ってAndroid標準ブラウザ判定

Last updated at Posted at 2017-03-30

以前使用したので共有がてらメモ
以下の2つのサイトの判定基準を使うとほとんどのAndroid標準ブラウザを判定できると思われ。
http://www.rainorshine.asia/2013/06/03/post2422.html
http://qiita.com/narikei/items/ada44891cb0902efc165

コードはこんな感じかな。


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標準ブラウザだったときの処理
}

「そうじゃない」という情報があったら、コメントくださるとありがたいです。

8
9
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9