浏览器的分类
浏览器的分类
获取浏览器的类型
const MobileMatches: ReadonlyArray<string> = [ \'Needle\', \'Android\', \'Symbian\', \'UCWEB\', \'iPhone\', \'iPad\', \'iPod\', \'BlackBerry\', \'Windows Phone\', ] export default { isMobile() { let isMobile = false const ua = window.navigator.userAgent MobileMatches.forEach(name => { !isMobile && (isMobile = !!ua.match(new RegExp(`${name}`, \'i\'))) }) return isMobile }, isEBai() { const EBaiAppReg = /AliApp\(EB\// return EBaiAppReg.test(window.navigator.userAgent) }, } const MobileMatches: ReadonlyArray<string> = [ \'Needle\', \'Android\', \'Symbian\', \'UCWEB\', \'iPhone\', \'iPad\', \'iPod\', \'BlackBerry\', \'Windows Phone\', ] export default { isMobile() { let isMobile = false const ua = window.navigator.userAgent MobileMatches.forEach(name => { !isMobile && (isMobile = !!ua.match(new RegExp(`${name}`, \'i\'))) }) return isMobile }, isEBai() { const EBaiAppReg = /AliApp\(EB\// return EBaiAppReg.test(window.navigator.userAgent) }, }
版权声明:本文为sexintercourse原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。