// 通过判断浏览器的userAgent
const userAgent = navigator.userAgent;
const isiOS = !!userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
const isAndroid = userAgent.indexOf('Android') > -1 || userAgent.indexOf('Adr') > -1;
// alert('是否是Android:'+isAndroid);
// alert('是否是iOS:'+isiOS);
标签:const,IOS,是否是,JS,userAgent,Android
From: https://www.cnblogs.com/aahan/p/17643764.html