android下的userAgent
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
ios下的userAgent
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
javascript 代码:
isWx: function(){ var ua = navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) && ua.match(/MicroMessenger/i)[0] === "micromessenger") { return true; } else { return false; }}
时间: 2024-11-10 01:23:36