Skip to content

Instantly share code, notes, and snippets.

@pokka
Forked from cary929/wechat-browser-detect.js
Last active May 31, 2017 01:49
Show Gist options
  • Save pokka/40d13863bed948b7739d38f8197f4e14 to your computer and use it in GitHub Desktop.
Save pokka/40d13863bed948b7739d38f8197f4e14 to your computer and use it in GitHub Desktop.
JavaScript 判断是否微信内置浏览器
// 使用 userAgent 判断是否微信内置浏览器
if( navigator.userAgent.toLowerCase().indexOf('micromessenger') > -1 || typeof navgator.wxuserAgent !== "undefined" ) {
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment