isPCBroswer:检测是否为PC端浏览器模式

function isPCBroswer() {    
  let e = navigator.userAgent.toLowerCase()

    , t = "ipad" == e.match(/ipad/i)

    , i = "iphone" == e.match(/iphone/i)

    , r = "midp" == e.match(/midp/i)

    , n = "rv:1.2.3.4" == e.match(/rv:1.2.3.4/i)

    , a = "ucweb" == e.match(/ucweb/i)

    , o = "android" == e.match(/android/i)

    , s = "windows ce" == e.match(/windows ce/i)

    , l = "windows mobile" == e.match(/windows mobile/i);

    return !(t || i || r || n || a || o || s || l)
}
posted @ 2020-01-19 15:08  入坑的H  阅读(191)  评论(0编辑  收藏  举报