forked from mumuy/browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
204 lines (203 loc) · 5.98 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!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>
<meta name="description" content="通过Useragent和浏览器环境变量等方式判断浏览器、系统及设备类型,是页面判断检测的常用工具。">
<meta name="keywords" content="Useragent,用户代理,浏览器判断,浏览器类型,浏览器信息">
<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;
}
.module .code{
padding: 10px;
margin-bottom: 5px;
background: #f8f8f8;
line-height: 24px;
font-size: 14px;
border-radius: 6px;
}
.module .code p{
margin: 0;
line-height: 20px;
}
.module table{
width: 100%;
margin-bottom: 20px;
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;
}
.mod-foot{
line-height: 40px;
text-align: right;
}
.mod-foot .btn{
position: relative;
display: inline-block;
min-width: 56px;
height: 34px;
background: #fff;
padding: 0 12px;
border: 1px solid #ececec;
border-radius: 6px;
line-height: 34px;
text-decoration: none;
text-align: center;
font-size: 14px;
color: #333;
overflow: hidden;
transition: color .2s,opacity .2s;
font-family: Tahoma,Arial, Helvetica,"Microsoft YaHei";
outline: none;
-webkit-appearance: none;
}
.mod-foot .btn:after {
content: " ";
position: absolute;
width: 100%;
height: 100%;
background: #000;
left: 0;
top: 0;
opacity: 0;
transition: opacity .2s;
border-radius: 6px;
overflow: hidden;
pointer-events: none;
}
.mod-foot .btn span,.mod-foot .btn svg{
vertical-align: middle;
}
.mod-foot .btn svg,.mod-foot .btn svg+span{
position: relative;
top: -1px;
}
.mod-foot .btn:hover {
color: #000;
opacity: 1;
}
.mod-foot .btn:hover:after {
opacity: .02;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container">
<div class="module">
<script>
var info = browser();
if(info.device!='Mobile'){
document.writeln('<table>\
<caption><div class="code">'+navigator.userAgent+'</div></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">
<div class="mod-foot">
<a class="btn" href="https://github.com/mumuy/browser/" rel="nofollow" target="_blank" title="Github">
<svg aria-hidden="true" class="octicon" height="20" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
<span>Github</span>
</a>
<a class="btn" href="https://www.ip138.com/useragent/" target="_blank">Useragent分析</a>
<a class="btn" href="/">返回首页</a>
</div>
</div>
</div>
<div style="display: none;">
<script>
document.writeln('<iframe src="https://passer-by.com/browser/stat.html?browser='+info.browser+'&ua='+navigator.userAgent+'" width="" height=""></iframe>');
</script>
</div>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?b86879c9cc57dd112fe1f7dd75206b82";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript" src="https://passer-by.com/public/script/projects.js"></script>
</body>
</html>