Cocos Creator(JavaScript携帯のタイプ判断)

943 ワード


携帯のタイプ判断
1 var BrowserInfo = {
2     userAgent: navigator.userAgent.toLowerCase()
3     isAndroid: Boolean(navigator.userAgent.match(/android/ig)),
4     isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)),
5     isIpad: Boolean(navigator.userAgent.match(/ipad/ig)),
6     isWeixin: Boolean(navigator.userAgent.match(/MicroMessenger/ig)),
7 }
 
転載先:https://www.cnblogs.com/luorende/p/10857118.html