// Judging whether it is the js code of QQ browser or WeChat browser
isWx = function() {
var ua = navigator.userAgent.toLowerCase();
return ua.match(/MicroMessenger/i) == 'micromessenger';
},
/ / whether QQ
isQQ = function() {
var ua = navigator.userAgent.toLowerCase();
return !!ua.match(/mqqbrowser|qzone|qqbrowser/i);
}
//Judgment, if-elseif order cannot be reversed
if (isWx()) {
alert('WeChat sharing')
//It is WeChat
} else if (isQQ()) {
alert('It is QQ')
//It is QQ
}