1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

fix Android tablet detection

fix #136
This commit is contained in:
Denis Demchenko 2016-05-09 09:44:04 +03:00
parent b9edb72e2f
commit 78ee04fa37
2 changed files with 35 additions and 2 deletions

View File

@ -306,9 +306,24 @@
// device type extraction // device type extraction
var osMajorVersion = osVersion.split('.')[0]; var osMajorVersion = osVersion.split('.')[0];
if (tablet || nexusTablet || 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 || nexusMobile || result.blackberry || result.webos || result.bada) { } else if (
mobile
|| iosdevice == 'iphone'
|| iosdevice == 'ipod'
|| android
|| nexusMobile
|| result.blackberry
|| result.webos
|| result.bada
) {
result.mobile = t result.mobile = t
} }

View File

@ -141,6 +141,24 @@ module.exports.useragents = {
, mobile: true , mobile: true
, a: true , a: true
} }
, 'Mozilla/5.0 (Linux; Android 5.0.2; SM-T705 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.105 Safari/537.36': {
chrome: true
, android: true
, version: '49.0'
, osversion: '5.0.2'
, blink: true
, a: true
, tablet: true
}
, 'Mozilla/5.0 (Linux; Android 6.0.99; Build/NPC91K) AppleWebKit/537.36(KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36': {
chrome: true
, android: true
, tablet: true
, osversion: '6.0.99'
, version: '50.0'
, blink: true
, a: true
}
} }
, 'Amazon Silk': { , 'Amazon Silk': {
'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true': { 'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true': {