Skip to content

Commit 03e69e6

Browse files
committed
add platform checkcode
1 parent dde86dc commit 03e69e6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modcode/platform.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function isWechat() {
2+
var ua = navigator.userAgent.toLowerCase();
3+
return /micromessenger/i.test(ua);
4+
}
5+
6+
function isQQBrowser() {
7+
var ua = navigator.userAgent.toLowerCase();
8+
return /Mobile MQQBrowser/i.test(ua);
9+
}
10+
11+
function isAndroid() {
12+
var ua = navigator.userAgent.toLowerCase();
13+
return /android/i.test(ua);
14+
}

0 commit comments

Comments
 (0)