How to detect the stock Android browser

前端 未结 14 1896
不思量自难忘°
不思量自难忘° 2020-12-08 01:52

Navigating to http://whatsmyuseragent.com/ shows me my stock Android browser on my Galaxy Nexus running 4.2.1 has the user agent

Mozilla/5.0 (X11; Linux x86_         


        
14条回答
  •  [愿得一人]
    2020-12-08 02:53

    It looks like the presence of "Linux; U; Android" is a consistent differentiator for the stock browser. Who knows what the "U" means, but I suspect it will be unreliable in the future. Hopefully the browser will either go away or start to play like Chrome when the strings change. Some other strings are below for comparison

    Android Chrome: "Mozilla/5.0 (Linux; Android 4.1.2; SAMSUNG-SGH-I727 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.94 Mobile Safari/537.36"

    Android Firefox: "Mozilla/5.0 (Android; Mobile; rv:23.0) Gecko/23.0 Firefox/23.0"

    Android Opera: "Mozilla/5.0 (Linux; Android 4.1.2; SAMSUNG-SGH-I727 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Mobile Safari/537.36 OPR/15.0.1162.61541"

提交回复
热议问题