// JS determines whether the micro channel opens in a browser function is_weixn () { var UA = navigator.userAgent.toLowerCase (); IF (ua.match (/ MicroMessenger / I) == "micromessenger" ) { return to true ; } the else { return to false ; } } the console.log (is_weixn ());