Created
October 8, 2014 04:21
-
-
Save foru17/e73c62c50807e637c823 to your computer and use it in GitHub Desktop.
js判断微信内置浏览器
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 在 Android 下 UA | |
* 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 下 UA | |
* 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 | |
*/ | |
function isWeixinBrowser(){ | |
var ua = navigator.userAgent.toLowerCase(); | |
return (/micromessenger/.test(ua)) ? true : false ; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment