
如题,查了半天查不到
|  |      1cheeto      2019-11-25 16:24:01 +08:00  1 你指的是在 line 或 FB 中打开么。。。 用 UA ``` var versiOns= function (){ var u = navigator.userAgent, app = navigator.appVersion; var ua = navigator.userAgent.toLowerCase(); return { //移端器版本信息 trident: u.indexOf('Trident') > -1, //IE 核心 presto: u.indexOf('Presto') > -1, //opera 核心 webKit: u.indexOf('AppleWebKit') > -1, //Apple, google 核心 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //Firefox 核心 mobile: !!u.match(/AppleWebKit.*Mobile.*/), //行置 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android 或 uc 器 iPhone: u.indexOf('iPhone') > -1, //是否 iPhone 或者 QQHD 器 iPad: u.indexOf('iPad') > -1, //是否 iPad webApp: u.indexOf('Safari') == -1, //是否 web 应该程序,没有头部与底部 iosv: u.substr(u.indexOf('iPhone OS') + 9, 3),//ios 版本 weixin: ua.match(/MicroMessenger/i) == "micromessenger",//微信器 fbapp: u.indexOf('FBAV') > -1,//Facebook App 器 line: u.indexOf('Line') > -1//Line 器 }; }(); // redir to mobile version if( versions.mobile ){ location.href = 'https://' + location.hostname + '/mobile.html'; } // inside of weixin app if( versions.weixin ){ }else{ } ``` |