乐趣区

javaScript客户端判断

// 安卓客户端
const isAndroid = window.navigator.userAgent.indexOf("Android") >= 0;
//IOS 客户端
const isIOS = /(iPhone|iPad|iPod|iOS|Mac)/i.test(navigator.userAgent);
// 判断 app
const userAgent = window.navigator.userAgent;
const isApp = userAgent.indexOf("自定义参数") !== -1 || userAgent.search("自定义参数") !== -1 || /(自定义参数)/.test(userAgent);
// 微信内置浏览器
const isWeChat = navigator.userAgent.match(/(MicroMessenger)/i) !== null;
退出移动版