From 542277ceb74fd55a31f6fc3c32aaf3bac476a864 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Mon, 9 May 2016 10:40:47 +0300 Subject: [PATCH] add Xbox detection #fix 139 --- src/bowser.js | 7 +++++-- src/useragents.js | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 08d9a86..be555e0 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -45,6 +45,7 @@ , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) , tablet = /tablet/i.test(ua) , mobile = !tablet && /[^-]mobi/i.test(ua) + , xbox = /xbox/i.test(ua) , result if (/opera|opr|opios/i.test(ua)) { @@ -295,10 +296,12 @@ } else if (iosdevice) { result[iosdevice] = t result.ios = t - } else if (windows) { - result.windows = t } else if (mac) { result.mac = t + } else if (xbox) { + result.xbox = t + } else if (windows) { + result.windows = t } else if (linux) { result.linux = t } diff --git a/src/useragents.js b/src/useragents.js index 1d39f2b..3d16b84 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -624,6 +624,12 @@ module.exports.useragents = { , windows: 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': { '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': {