标签:bsp agent rom his opera chrome http 判断 navig
function Browser() { this.Opera = window.opera ? true : false; this.IE = document.all && !this.Opera ? true : false; this.IE6 = this.IE && typeof(window.XMLHttpRequest) == "undefined" ? true : false; this.IE8 = this.IE && typeof(document.querySelectorAll) != "undefined" ? true : false; this.IE7 = this.IE && !this.IE6 && !this.IE8 ? true : false; this.WebKit = /WebKit/i.test(navigator.userAgent) ? true : false, this.iPhone = /iPhone|iPod/i.test(navigator.userAgent) ? true : false; this.Chrome = /Chrome/i.test(navigator.userAgent) ? true : false; this.Safari = /Safari/i.test(navigator.userAgent) && !this.Chrome ? true : false; this.Konqueror = navigator.vendor == "KDE" ? true : false; this.Konqueror4 = this.Konqueror && /native code/.test(document.getElementsByClassName) ? true : false; this.Gecko = !this.WebKit && navigator.product == "Gecko" ? true : false; this.Gecko19 = this.Gecko && Array.reduce ? true : false; this.toString = "Opera=" + this.Opera + ",IE=" + this.IE + ",IE6=" + this.IE6 + ",IE7=" + this.IE7 + ",IE8=" + this.IE8 + ",Chrome=" + this.Chrome; }
标签:bsp agent rom his opera chrome http 判断 navig
原文地址:http://www.cnblogs.com/zxcc/p/7844618.html