Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
duhongbin01 committed Jul 15, 2017
1 parent e1ccbe7 commit 04c62bb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/ua-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,17 @@ module.exports = function (ua) {
* Android Chrome Browser
*/
else if (uaData.os.name === 'Android' && /safari/i.test(ua) && (match = /chrome\/([0-9\.]+)/i.exec(ua))) {
uaData.browser.name = 'Android Chrome';
uaData.browser.version = {original: match[1]};
if (tmpMatch = ua.match(/\s+(\w+Browser)\/?([\d\.]*)/)) {
uaData.browser.name = tmpMatch[1];
if (tmpMatch[2]) {
uaData.browser.version = {original: tmpMatch[2]};
} else {
uaData.browser.version = {original: match[1]};
}
} else {
uaData.browser.name = 'Android Chrome';
uaData.browser.version = {original: match[1]};
}
}

/**
Expand Down

0 comments on commit 04c62bb

Please sign in to comment.