mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Detect chrome book user agent.
This commit is contained in:
parent
7ff16b172d
commit
38f79cf152
@ -24,6 +24,7 @@
|
||||
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
|
||||
, likeAndroid = /like android/i.test(ua)
|
||||
, android = !likeAndroid && /android/i.test(ua)
|
||||
, chromeBook = /CrOS/.test(ua)
|
||||
, edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i)
|
||||
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
|
||||
, tablet = /tablet/i.test(ua)
|
||||
@ -64,8 +65,14 @@
|
||||
, msie: t
|
||||
, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
|
||||
}
|
||||
} else if (chromeBook) {
|
||||
result = {
|
||||
name: 'Chrome'
|
||||
, chromeBook: t
|
||||
, chrome: t
|
||||
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
|
||||
}
|
||||
else if (/chrome.+? edge/i.test(ua)) {
|
||||
} else if (/chrome.+? edge/i.test(ua)) {
|
||||
result = {
|
||||
name: 'Microsoft Edge'
|
||||
, msedge: t
|
||||
|
@ -86,6 +86,7 @@ module.exports.useragents = {
|
||||
}
|
||||
, 'Mozilla/5.0 (X11; CrOS i686 4319.74.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36': {
|
||||
chrome: true
|
||||
, chromeBook: true
|
||||
, version: '29.0'
|
||||
, webkit: true
|
||||
, a: true
|
||||
|
Loading…
Reference in New Issue
Block a user