前言
- 这里点名批评国内厂商,用谷歌开源的浏览器做的产品,还不加上自己的 UserAgent 识别信息
- 着重批评下 360,只有他自己的网站才会在 user-agent 里面加上识别信息,其他网站屏蔽
判断方法
const isSupportBrowser = () => {
const agent = navigator.userAgent.toLocaleLowerCase()
const mimeType = _.map(navigator.mimeTypes, item => item.type).join(',').toLowerCase()
if (mimeType.includes('360soft') || mimeType.includes('tecent')) {
return false
}
if (agent.includes('qihu')) {
return false
}
if (agent.includes('360se')) {
return false
}
if (agent.includes('360gt')) {
return false
}
if (agent.includes('qqbrowser')) {
return false
}
if (agent.includes('tencent')) {
return false
}
if (agent.includes('firefox')) {
return false
}
if (agent.includes('maxthon')) {
return false
}
if (agent.includes('taobrowser')) {
return false
}
if (agent.includes('metasr')) {
return false
}
if (agent.includes('ubrowser')) {
return false
}
return true
}