開發者模式/DevTools、More tools/Network conditions/User agent/ Custom/安卓或ios代理配置配置html
安卓微信UA: linux
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352 android
Ios微信UA:ios
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0 web
//判斷是否微信瀏覽器 function isWeixinBrowser() { var ua = navigator.userAgent.toLowerCase(); var result = (/micromessenger/.test(ua)) ? true : false; if (result) { console.log('你正在訪問微信瀏覽器'); } else { console.log('你訪問的不是微信瀏覽器'); } return result; }; isWeixinBrowser();