1 Star 0 Fork 2

冒险家/浏览器名字 版本 内核检测

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 3.03 KB
一键复制 编辑 原始数据 按行查看 历史
king-lxt 提交于 2017-09-07 18:09 . add browser in brower.js
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<title>浏览器测试</title>
<script src="Browser.js"></script>
<style>
a{
text-decoration: none;
color: #757575;
}
a:hover{
text-decoration: underline;
}
.wrapper{
width: 100%;
max-width: 960px;
margin: 0 auto;
}
.container{
margin-bottom: 20px;
}
.footer{
line-height: 40px;
text-align: right;
}
.footer a{
margin: 0 5px;
}
.module table{
width: 100%;
table-layout: fixed;
border-collapse: collapse;
border-spacing: 0;
text-align: center;
}
.module thead{
background: #eee;
}
.module th,.module td{
padding: 8px 5px;
line-height: 24px;
border: 1px solid #eee;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container">
<div class="module">
<script>
var info = new Browser();
if(info.device!='Mobile'){
document.writeln('<table>\
<caption><p>'+navigator.userAgent+'</p></caption>\
<thead>\
<tr>\
<th>浏览器</th>\
<th>版本</th>\
<th>内核</th>\
<th>操作系统</th>\
<th>设备</th>\
<th>语言</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+info.browser+'</td>\
<td>'+info.version+'</td>\
<td>'+info.engine+'</td>\
<td>'+info.os+' '+info.osVersion+'</td>\
<td>'+info.device+'</td>\
<td>'+info.language+'</td>\
</tr>\
</tbody>\
</table>');
}else{
document.writeln('<table>\
<caption><p>'+navigator.userAgent+'</p></caption>\
<thead>\
<tr>\
<th>浏览器</th>\
<th>版本</th>\
<th>内核</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+info.browser+'</td>\
<td>'+info.version+'</td>\
<td>'+info.engine+'</td>\
</tr>\
</tbody>\
</table>');
document.writeln('<table>\
<thead>\
<tr>\
<th>操作系统</th>\
<th>设备</th>\
<th>语言</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+info.os+' '+info.osVersion+'</td>\
<td>'+info.device+'</td>\
<td>'+info.language+'</td>\
</tr>\
</tbody>\
</table>');
}
</script>
</div>
</div>
<div class="footer">
<a href="https://github.com/mumuy/browser" target="_blank">项目地址</a>
<a href="/">返回首页</a>
</div>
</div>
<!--<div style="display: none;">
<script src="http://s95.cnzz.com/z_stat.php?id=1258310068&web_id=1258310068"></script>
<script>
document.writeln('<iframe src="http://passer-by.com/browser/stat.html?browser='+info.browser+'&ua='+navigator.userAgent+'" width="" height=""></iframe>');
</script>
</div>-->
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/justperfect/LiuLanQiMingZi-BanBen-NaHeJianCe.git
git@gitee.com:justperfect/LiuLanQiMingZi-BanBen-NaHeJianCe.git
justperfect
LiuLanQiMingZi-BanBen-NaHeJianCe
浏览器名字 版本 内核检测
master

搜索帮助