abbott-methods
Version:
abbott,methods,method,functions,function
12 lines (11 loc) • 370 B
text/typescript
/**
* @description 浏览器是否手机浏览器
* @returns {Boolean}
*/
export const browserIsMobile = (): boolean => {
if (navigator.userAgent.match(/('phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone')/i)) {
return true
} else {
return false
}
}