navigator
作者:
洛洛kkkkkk | 来源:发表于
2017-04-20 19:19 被阅读0次<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>navigator</title>
</head>
<body>
</body>
<script type="text/javascript">
//浏览器嗅探
console.log(window.navigator);
//代表浏览器中安装的插件
console.log(window.navigator.plugins);
//当前浏览器的版本/信息
console.log(window.navigator.userAgent);
//通过userAgent来判断浏览器是哪一种浏览器
if(window.navigator.userAgent.indexOf("Chrome")!=-1){
console.log("这是谷歌浏览器") ;
}
</script>
</html>
本文标题:navigator
本文链接:https://www.haomeiwen.com/subject/npolzttx.html
网友评论