1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" 3
4 head 5 meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 title>浏览器检测</ 7 8
9 script10 window.onload = function () {
11
12 //application/vnd.chromium.remoting-viewer 可能为360特有
13 var is360 = _mime("type,application/vnd.chromium.remoting-viewer);
14
15 if (isChrome() && is360) {
16 alert(检测到是360浏览器17 }
18 }
19 检测是否是谷歌内核(可排除360及谷歌以外的浏览器)
20 isChrome(){
21 ua navigator.userAgent.toLowerCase();
22
23 return ua.indexOf(chrome) > 1;
24 25 测试mime
26 _mime(option,value) {
27 mimeTypes navigator.mimeTypes;
28 for ( mt in mimeTypes) {
29 (mimeTypes[mt][option] == value) {
30 return true31 }
32 33 false34 35 36
37 body38 39
40 html>