JS判断移动PC高级版防止F12欺骗

Js 2019-10-13 22:00:40 评论
 
<script>
var system = {
    win: false,
    mac: false,
    iPhone: false,
    xll: false,
    ipad: false,
    Android: false,
    Ios: false
};

var p = navigator.platform;
var u = navigator.userAgent;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.iPhone = p.indexOf('iPhone') == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
system.ipad = (navigator.userAgent.match(/iPad/i) != null) ? true : false;
system.Android = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
system.ios = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (system.win || system.mac ) {
   document.writeln("pc");
}else{
   document.writeln("wap");
}
</script>
JS判断移动PC高级版防止F12欺骗JS判断移动PC高级版防止F12欺骗
 

评论

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!