var ua = window.navigator.userAgent.toLowerCase(); console.log(ua); if (ua.match(/MicroMessenger/i) == 'micromessenger') { console.log("微信内置浏览器") }