//是否为opera内核
IS_OT: 0 > navigator.userAgent.indexOf("Presto/2.4.") && 0 > navigator.userAgent.indexOf("Presto/2.3.") && 0 > navigator.userAgent.indexOf("Presto/2.2.") && 0 > navigator.userAgent.indexOf("Presto/2.1.") && 0 > navigator.userAgent.indexOf("Presto/2.0.") && 0 > navigator.userAgent.indexOf("Presto/1.");
//是否为苹果、谷歌内核
IS_SF: 0 <= navigator.userAgent.indexOf("AppleWebKit/") && 0 > navigator.userAgent.indexOf("Chrome/");
//是否支持ontouchstart相关的事件
IS_TOUCH: "ontouchstart" in document.documentElement,
//是否支持MSPointer相关的事件
IS_POINTER: null != window.navigator.msPointerEnabled ? window.navigator.msPointerEnabled : !1,
//是否为ie
IS_IE: 0 <= navigator.userAgent.indexOf("MSIE");
//是否为ie6
IS_IE6: 0 <= navigator.userAgent.indexOf("MSIE 6");
//是否为ie11
IS_IE11: !! navigator.userAgent.match(/Trident\/7\./);
//是否为怪异模式
IS_QUIRKS: 0 <= navigator.userAgent.indexOf("MSIE") && (null == document.documentMode || 5 == document.documentMode);(浏览器怪异模式)
IS_NS: 0 <= navigator.userAgent.indexOf("Mozilla/") && 0 > navigator.userAgent.indexOf("MSIE");
//是否为Opera
IS_OP: 0 <= navigator.userAgent.indexOf("Opera/");
//是否为iso
IS_IOS: navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? !0 : !1;
//是否为Chrome
IS_GC: 0 <= navigator.userAgent.indexOf("Chrome/");
//是否为Firefox
IS_FF: 0 <= navigator.userAgent.indexOf("Firefox/");
IS_MT: 0 <= navigator.userAgent.indexOf("Firefox/") && 0 > navigator.userAgent.indexOf("Firefox/1.") && 0 > navigator.userAgent.indexOf("Firefox/2.") || 0 <= navigator.userAgent.indexOf("Iceweasel/") && 0 > navigator.userAgent.indexOf("Iceweasel/1.") && 0 > navigator.userAgent.indexOf("Iceweasel/2.") || 0 <= navigator.userAgent.indexOf("SeaMonkey/") && 0 > navigator.userAgent.indexOf("SeaMonkey/1.") || 0 <= navigator.userAgent.indexOf("Iceape/") && 0 > navigator.userAgent.indexOf("Iceape/1.");
//是否支持svg
IS_SVG: 0 <= navigator.userAgent.indexOf("Firefox/") || 0 <= navigator.userAgent.indexOf("Iceweasel/") || 0 <= navigator.userAgent.indexOf("Seamonkey/") || 0 <= navigator.userAgent.indexOf("Iceape/") || 0 <= navigator.userAgent.indexOf("Galeon/") || 0 <= navigator.userAgent.indexOf("Epiphany/") || 0 <= navigator.userAgent.indexOf("AppleWebKit/") || 0 <= navigator.userAgent.indexOf("Gecko/") || 0 <= navigator.userAgent.indexOf("Opera/") || null != document.documentMode && 9 <= document.documentMode;
//是否支持foreignObject
NO_FO: !document.createElementNS || "[object SVGForeignObjectElement]" != document.createElementNS("http://www.w3.org/2000/svg", "foreignObject") || 0 <= navigator.userAgent.indexOf("Opera/");
//是否为ie浏览器
IS_VML: "MICROSOFT INTERNET EXPLORER" == navigator.appName.toUpperCase();
//是否为Win
IS_WIN: 0 < navigator.appVersion.indexOf("Win");
//是否为Mac
IS_MAC: 0 < navigator.appVersion.indexOf("Mac");
//是否为本地地址
IS_LOCAL: 0 > document.location.href.indexOf("http://") && 0 > document.location.href.indexOf("https://");
浏览器+移动端 js 判断
最新推荐文章于 2025-05-27 17:00:50 发布