-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
增加手机百度和夸克浏览器的规则 #113
增加手机百度和夸克浏览器的规则 #113
Conversation
Mozilla/5.0 (Linux; U; Android 6.0.1; zh-cn; OPPO R9s Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.0.0 Mobile Safari/537.36 OppoBrowser/4.2.8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这些浏览器的占比数据提供下,占比小的建议放在 rules.js 而不是 web-rules.js 里。
- 添加测试用例。
lib/web-rules.js
Outdated
@@ -87,7 +87,7 @@ const DEVICES = [ | |||
return /\bhtc[ _\-]?([a-z0-9 ]+)/; | |||
} | |||
}], | |||
["oppo", /\boppo[_]([a-z0-9]+)/], | |||
["oppo", /\boppo[_ ]([a-z0-9]+)/i], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ua 字符串会被转为小写,不用添加 i 标记。
lib/web-rules.js
Outdated
}], | ||
["quark", function (ua) { | ||
if (ua.indexOf('quark/') >= 0) { | ||
return (/\bquark\/([0-9.]+)/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["quark": /\bquark\/([0-9.]+)/],
lib/web-rules.js
Outdated
}], | ||
["oppo", function (ua) { | ||
if (ua.indexOf('oppobrowser/') >= 0) { | ||
return (/\boppobrowser\/([0-9.]+)/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["oppobrowser": /\boppobrowser\/([0-9.]+)/],
lib/web-rules.js
Outdated
@@ -304,6 +304,21 @@ const BROWSER = [ | |||
return /\b(?:ucbrowser|uc)\b/; | |||
} | |||
}], | |||
["baidubox", function (ua) { | |||
if (ua.indexOf('baiduboxapp/') >= 0) { | |||
return (/\bbaiduboxapp\/([0-9.]+)/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["baidubox", /\bbaiduboxapp\/([0-9.]+)/],
我们这边手机百度和oppo占比略大。 我在实现一个无线端 |
fix #111 #112