标签:presto ons 判断 cpu index test htm res hone
const ua = navigator.userAgent;
this.ua = ua;
this.trident = ua.indexOf(‘Trident‘) > -1; // ie
this.presto = ua.indexOf(‘Presto‘) > -1; // opera
this.webKit = ua.indexOf(‘AppleWebKit‘) > -1; // applewebkit
this.gecko = ua.indexOf(‘Gecko‘) > -1 && ua.indexOf(‘KHTML‘) == -1; // firefox
this.mobile = !!ua.match(/AppleWebKit.*Mobile.*/); // mobile
this.ios = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios
this.android = ua.indexOf(‘Android‘) > -1 || ua.indexOf(‘Linux‘) > -1; // android or uc
this.iphone = ua.indexOf(‘iPhone‘) > -1; // iphone or qq
this.ipad = ua.indexOf(‘iPad‘) > -1; // ipad
this.weibo = /weibo/i.test(ua) ? true : false;
this.weixin = /micromessenger/i.test(ua) ? true : false;
this.app = /jumei/i.test(navigator.userAgent) ? true : false;
this.wkWebview = /WKWebView\/1/g.test(ua) ? true : false;
this.isHybrid = (window as any)._isHybrid
标签:presto ons 判断 cpu index test htm res hone
原文地址:https://www.cnblogs.com/ganmy/p/9057086.html