测试程序是很简单的一行:
<
script type
=
"
text/javascript
"
>
alert(navigator.userAgent);
<
/
script>
测试结果如下:
傲游(Maxthon)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)
腾讯TT
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)
世界之窗(The World) 2.x
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
世界之窗(The World) 3.x
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)
搜狗浏览器 1.x
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SE 1.X; SE 1.X)
360浏览器
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)
Avant
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser)
Green Browser
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
世界之窗2.x和Green Browser都没有特别的标识;世界之窗 3.x、360浏览器和Avant Browser没有标注版本号;360浏览器和搜狗浏览器的标识都有“SE”;搜狗浏览器出现了两段标识。