mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
add Xbox detection
#fix 139
This commit is contained in:
parent
5321a33cbe
commit
542277ceb7
@ -45,6 +45,7 @@
|
|||||||
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
|
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
|
||||||
, tablet = /tablet/i.test(ua)
|
, tablet = /tablet/i.test(ua)
|
||||||
, mobile = !tablet && /[^-]mobi/i.test(ua)
|
, mobile = !tablet && /[^-]mobi/i.test(ua)
|
||||||
|
, xbox = /xbox/i.test(ua)
|
||||||
, result
|
, result
|
||||||
|
|
||||||
if (/opera|opr|opios/i.test(ua)) {
|
if (/opera|opr|opios/i.test(ua)) {
|
||||||
@ -295,10 +296,12 @@
|
|||||||
} else if (iosdevice) {
|
} else if (iosdevice) {
|
||||||
result[iosdevice] = t
|
result[iosdevice] = t
|
||||||
result.ios = t
|
result.ios = t
|
||||||
} else if (windows) {
|
|
||||||
result.windows = t
|
|
||||||
} else if (mac) {
|
} else if (mac) {
|
||||||
result.mac = t
|
result.mac = t
|
||||||
|
} else if (xbox) {
|
||||||
|
result.xbox = t
|
||||||
|
} else if (windows) {
|
||||||
|
result.windows = t
|
||||||
} else if (linux) {
|
} else if (linux) {
|
||||||
result.linux = t
|
result.linux = t
|
||||||
}
|
}
|
||||||
|
@ -624,6 +624,12 @@ module.exports.useragents = {
|
|||||||
, windows: true
|
, windows: true
|
||||||
, c: true
|
, c: true
|
||||||
}
|
}
|
||||||
|
, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Xbox; Xbox One)': {
|
||||||
|
xbox: true
|
||||||
|
, msie: true
|
||||||
|
, version: '10.0'
|
||||||
|
, a: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
, 'Microsoft Edge': {
|
, 'Microsoft Edge': {
|
||||||
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0': {
|
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0': {
|
||||||
|
Loading…
Reference in New Issue
Block a user