Problem Description
Since external links cannot be opened in the WeChat browser, if you want to click the button to download in the WeChat built-in browser, it will not be successful. At this time, we need to determine whether we are in the WeChat built-in browser and make different prompts.
As shown below:
Code to determine whether WeChat has a built-in browser
const ua = window.navigator.userAgent.toLowerCase()
let isWeixin = ua.indexOf('micromessenger') != -1;
if(isWeixin) {
// 微信内置浏览器内的操作
}else {
// 普通浏览器内的操作
}