Support all browsers on the phone, below to browse the code online
<! DOCTYPE html>
<title>js determine what device is what browser-webkfa.com</title>
<meta charset= "Utf-8" >
<meta name= "Apple-touch-fullscreen" content= "YES"/>
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, User-scalable=no "/>
<meta name= "apple-mobile-web-app-capable" content= "yes"/>
<meta name= "format-detection" content= "Telephone=no"/>
<body>
<div id= "divID" >
</div>
<script type= "Text/javascript" >
var os = function () {
var ua = navigator.useragent,
ISQB =/(?: mqqbrowser| QQ)/.test (UA),
Iswindowsphone =/(?: Windows Phone)/.test (UA),
Issymbian =/(?: SymbianOS)/.test (UA) | | Iswindowsphone,
Isandroid =/(?: Android)/.test (UA),
Isfirefox =/(?: Firefox)/.test (UA),
Ischrome =/(?: chrome| Crios)/.test (UA),
Isipad =/(?: ipad| PlayBook)/.test (UA),
Istablet =/(?: ipad| PlayBook)/.test (UA) | | (Isfirefox &&/(?: Tablet)/.test (UA)),
Issafari =/(?: Safari)/.test (UA),
Isphone =/(?: IPhone)/.test (UA) &&!istablet,
Isopen=/(?: O Pera Mini)/.test (UA),
ISUC =/(?: ucweb| Ucbrowser)/.test (UA),
IsPc =!isphone &&!isandroid &&!issymbian;
return {
ISQB:ISQB,
Istablet:istablet,
Isphone:isphone,
Isandroid:isandroid,
ISPC:ISPC,
Isopen:isopen,
ISUC:ISUC,
Isipad:isipad
};
}();
var html=[];
Html[html.length]= ' is the QQ browser: ' +os.isqb+ ' <br/> ';
Html[html.length]= ' is the tablet: ' +os.istablet+ ' <br/> ';
Html[html.length]= ' is phone: ' +os.isphone+ ' <br/> ';
Html[html.length]= ' is android: ' +os.isandroid+ ' <br/> ';
Html[html.length]= ' is a computer: ' +os.ispc+ ' <br/> ';
Html[html.length]= ' is Opera browser: ' +os.isopen+ ' <br/> ';
Html[html.length]= ' is a UC browser: ' +os.isuc+ ' <br/> ';
Html[html.length]= ' is the ipad: ' +os.isipad+ ' <br/> ';
document.getElementById ("divID"). Innerhtml=html.join ("");
</script>
</body>
Browse Online Code: http://www.webkfa.com/one8/w1591.html
JS Judging what device is what browser-primarily with mobile page development