Skip to content

Commit ca24e14

Browse files
heqianqian01qiansc
authored andcommitted
fix: update isGoogleChrome
1 parent 1e9ba2a commit ca24e14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ define(function () {
139139
* @return {boolean} chrome
140140
*/
141141
isGoogleChrome: function () {
142-
return /(?:Chrome|CrMo|CriOS)\/([0-9]{1,2}\.[0-9]\.[0-9]{3,4}\.[0-9]+)/i.test(ua) &&
143-
!/(samsung|miuibrowser|ucbrowser|qqbrowser|huaweibrowser|heytapbrowser|oppobrowser|vivobrowser|lebrowser|mzbrowser)/i.test(ua);
142+
var andrChrome = /^Mozilla\/(\d*?(\.\d*?)*?) \(Linux; Android (\d*?(\.\d*?)*?); .*?\) AppleWebKit\/(\d*?(\.\d*?)*?) \(KHTML, like Gecko\) Chrome\/(\d*?(\.\d*?)*?) Mobile Safari\/(\d*?(\.\d*?)*?)$/.test(ua);
143+
var iosChrome = /^Mozilla\/(\d*?(\.\d*?)*?) \(iPhone; CPU iPhone OS (\d*?(_\d*?)*?) like Mac OS X\) AppleWebKit\/(\d*?(\.\d*?)*?) \(KHTML, like Gecko\) CriOS\/(\d*?(\.\d*?)*?) Mobile\/(.*?) Safari\/(\d*?(\.\d*?)*?)$/.test(ua);
144+
return andrChrome || iosChrome;
144145
},
145146
// kernel
146147
isWKWebview: function () {

0 commit comments

Comments
 (0)