yy = {};
yy.detectBrowser = function() {
this.ua = navigator.userAgent;
this.isIE = (/msie/i).test(this.ua);
this.isFirefox = (/firefox/i).test(this.ua);
this.isChrome = (/chrome/i).test(this.ua);
this.isSafari = (/safari/i).test(this.ua) && !this.isChrome;
this.isMobile = (/mobile/i).test(this.ua);
this.isIOS = (/ios/i).test(this.ua);
this.isIpad = (/ipad/i).test(this.ua);
this.isIpod = (/ipod/i).test(this.ua);
this.isIphone = (/iphone/i).test(this.ua) && !this.isIpod;
this.isAndroid = (/android/i).test(this.ua);
this.supportStorage = window.localStorage != undefined;
this.supportOrient = "orientation" in window;
}
如何通过代码判断当前使用的是什么浏览器