根据判断UA中是否有关键字micromessenger,有的话则是微信内置浏览器 用Chrome的iPhone5模拟测试 //判断是否微信登陆 function isWeiXin() { var ua = window.navigator.userAgent.toLowerCase(); console.log(ua);//mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like…
/*判断(微信)浏览器*/ function isWeiXin(){var ua = window.navigator.userAgent.toLowerCase();if(ua.match(/MicroMessenger/i) == 'micromessenger'){return true;}else{return false;}}if(isWeiXin()){alert(1);}else{alert(2);} function isIe(){ if (!!window.ActiveXObj…
微信内置浏览器的 User Agent 如何判断微信内置浏览器,首先需要获取微信内置浏览器的User Agent,经过在 iPhone 上微信的浏览器的检测,它的 User Agent 是: Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329 MicroMessenger/5.0.1 所以通过识别 MicroMessenger…