mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Merge branch 'fix-nexus-mobile-tablet' of git://github.com/daemon1981/bowser into daemon1981-fix-nexus-mobile-tablet
This commit is contained in:
commit
71b69e822d
@ -24,6 +24,8 @@
|
|||||||
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
|
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
|
||||||
, likeAndroid = /like android/i.test(ua)
|
, likeAndroid = /like android/i.test(ua)
|
||||||
, android = !likeAndroid && /android/i.test(ua)
|
, android = !likeAndroid && /android/i.test(ua)
|
||||||
|
, nexusMobile = /nexus\s*[0-6]\s*/i.test(ua)
|
||||||
|
, nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua)
|
||||||
, chromeos = /CrOS/.test(ua)
|
, chromeos = /CrOS/.test(ua)
|
||||||
, silk = /silk/i.test(ua)
|
, silk = /silk/i.test(ua)
|
||||||
, sailfish = /sailfish/i.test(ua)
|
, sailfish = /sailfish/i.test(ua)
|
||||||
@ -270,7 +272,7 @@
|
|||||||
|
|
||||||
// device type extraction
|
// device type extraction
|
||||||
var osMajorVersion = osVersion.split('.')[0];
|
var osMajorVersion = osVersion.split('.')[0];
|
||||||
if (tablet || iosdevice == 'ipad' || (android && (osMajorVersion == 3 || (osMajorVersion == 4 && !mobile))) || result.silk) {
|
if (tablet || nexusTablet || iosdevice == 'ipad' || (android && (osMajorVersion == 3 || (osMajorVersion == 4 && !mobile))) || result.silk) {
|
||||||
result.tablet = t
|
result.tablet = t
|
||||||
} else if (mobile || iosdevice == 'iphone' || iosdevice == 'ipod' || android || result.blackberry || result.webos || result.bada) {
|
} else if (mobile || iosdevice == 'iphone' || iosdevice == 'ipod' || android || result.blackberry || result.webos || result.bada) {
|
||||||
result.mobile = t
|
result.mobile = t
|
||||||
|
@ -7,7 +7,16 @@
|
|||||||
*/
|
*/
|
||||||
module.exports.useragents = {
|
module.exports.useragents = {
|
||||||
Chrome: {
|
Chrome: {
|
||||||
'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 7 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36': {
|
'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 9 Build/LMY48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Safari/537.36': {
|
||||||
|
chrome: true
|
||||||
|
, android: true
|
||||||
|
, osversion: '5.1.1'
|
||||||
|
, tablet: true
|
||||||
|
, version: '47.0'
|
||||||
|
, webkit: true
|
||||||
|
, a: true
|
||||||
|
}
|
||||||
|
, 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 7 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36': {
|
||||||
chrome: true
|
chrome: true
|
||||||
, android: true
|
, android: true
|
||||||
, osversion: '4.4.2'
|
, osversion: '4.4.2'
|
||||||
@ -884,7 +893,7 @@ module.exports.useragents = {
|
|||||||
, osversion: '4.4.2'
|
, osversion: '4.4.2'
|
||||||
, webkit: true
|
, webkit: true
|
||||||
, version: 4.0
|
, version: 4.0
|
||||||
, mobile: true
|
, tablet: true
|
||||||
, x: true
|
, x: true
|
||||||
}
|
}
|
||||||
, 'Mozilla/5.0 (Linux; U; Android 4.3; de-de; Galaxy Nexus Build/JWR66Y) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30': {
|
, 'Mozilla/5.0 (Linux; U; Android 4.3; de-de; Galaxy Nexus Build/JWR66Y) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30': {
|
||||||
|
Loading…
Reference in New Issue
Block a user