判断是否是chrom浏览器外壳

判断是否是chrom浏览器外壳,自己加的360等外壳判断没啥道理,但是对比了一下参数凑合着用。。有好方法希望大神指点

//browser.js
var Browser=Browser || (function(window){
	var document = window.document,
		navigator = window.navigator,
		agent = navigator.userAgent.toLowerCase(),
		//IE8+支持.返回浏览器渲染当前文档所用的模式
		//IE6,IE7:undefined.IE8:8(兼容模式返回7).IE9:9(兼容模式返回7||8)
		//IE10:10(兼容模式7||8||9)
		IEMode = document.documentMode,
		//chorme
		chrome = window.chrome || false,
		System = {
			//user-agent
			agent : agent,
			//是否为IE
			isIE : /msie/.test(agent),
			//Gecko内核
			isGecko: agent.indexOf("gecko")>0 && agent.indexOf("like gecko")<0,
			//webkit内核
			isWebkit: agent.indexOf("webkit")>0,
			//是否为标准模式
			isStrict: document.compatMode === "CSS1Compat",
			//是否支持subtitle
			supportSubTitle:function(){
				return "track" in document.createElement("track");
			},
			//是否支持scoped
			supportScope:function(){
				return "scoped" in document.createElement("style");
			},
			//获取IE的版本号
			ieVersion:function(){
				try {
				   return agent.match(/msie ([\d.]+)/)[1] || 0;
				} catch(e) {
				   console.log("error");
				   return IEMode;
				}
			},
			//Opera版本号
			operaVersion:function(){
				try {
					if(window.opera) {
				
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值