Skip to content
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

add iOS Chrome browser #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/ua-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,14 @@ module.exports = function (ua) {
* 'Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206' belongs to Safari
*/
else if (/(ipad|iphone).* applewebkit\/.* mobile/i.test(ua)) {
uaData.browser.name = 'Safari';
// Chrome: Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/67.0.3396.87 Mobile/15F79 Safari/604.1
if (tmpMatch = ua.match(/(?:Chrome|CrMo|CriOS)\/([\d\.]*)/)) {
uaData.browser.name = 'Chrome';
uaData.browser.version = {original: tmpMatch[1]};
}
else{
uaData.browser.name = 'Safari';
}
}
}
if (match = ua.match(/baiduboxapp\/?([\d\.]*)/i)) {
Expand Down