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

fix Safari browser name on iOS

This commit is contained in:
Denis Demchenko 2016-05-07 18:55:19 +03:00
parent 8148486edf
commit 197c203e11
2 changed files with 164 additions and 153 deletions

View File

@ -117,15 +117,6 @@
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
} }
} }
else if (iosdevice) {
result = {
name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'
}
// WTF: version is not part of user agent in web apps
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if (sailfish) { else if (sailfish) {
result = { result = {
name: 'Sailfish' name: 'Sailfish'
@ -206,11 +197,22 @@
, version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
} }
} }
else if (/safari/i.test(ua)) { else if (/safari|applewebkit/i.test(ua)) {
result = { result = {
name: 'Safari' name: 'Safari'
, safari: t , safari: t
, version: versionIdentifier }
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if (iosdevice) {
result = {
name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'
}
// WTF: version is not part of user agent in web apps
if (versionIdentifier) {
result.version = versionIdentifier
} }
} }
else if(/googlebot/i.test(ua)) { else if(/googlebot/i.test(ua)) {

View File

@ -349,6 +349,157 @@ module.exports.useragents = {
, webkit: true , webkit: true
, c: true , c: true
} }
, 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11B554a': {
ios: true
, osversion: '7.0.4'
, iphone: true
, mobile: true
, webkit: true
, safari: true
, a: true
}
, 'Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5': {
ios: true
, osversion: '4.3.2'
, version: '5.0'
, iphone: true
, mobile: true
, safari: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3': {
ios: true
, version: '3.0'
, iphone: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d Safari/6531.22.7': {
ios: true
, osversion: '4.1'
, version: '4.0'
, iphone: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_2; en-gb) AppleWebKit/526+ (KHTML, like Gecko) Version/3.1 iPhone': {
ios: true
, version: '3.1'
, iphone: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A344 Safari/601.1': {
ios: true
, osversion: '9.0'
, version: '9.0'
, iphone: true
, mobile: true
, webkit: true
, safari: true
, a: true
}
, 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53': {
ios: true
, osversion: '7.0.4'
, name: 'Safari'
, version: '7.0'
, ipad: true
, tablet: true
, webkit: true
, safari: true
, a: true
}
, 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25': {
ios: true
, osversion: '6.0'
, name: 'Safari'
, version: '6.0'
, ipad: true
, tablet: true
, webkit: true
, safari: true
, a: true
}
, 'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3': {
ios: true
, osversion: '5.1'
, name: 'Safari'
, version: '5.1'
, ipad: true
, tablet: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5': {
ios: true
, osversion: '4.3.2'
, name: 'Safari'
, version: '5.0'
, ipad: true
, tablet: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; es-es) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B360 Safari/531.21.10': {
ios: true
, osversion: '3.2'
, name: 'Safari'
, version: '4.0'
, ipad: true
, tablet: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53': {
ios: true
, osversion: '7.0.3'
, version: '7.0'
, ipod: true
, mobile: true
, webkit: true
, safari: true
, a: true
}
, 'Mozilla/5.0 (iPod; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3': {
ios: true
, osversion: '5.1'
, version: '5.1'
, ipod: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5': {
ios: true
, osversion: '4.3.3'
, version: '5.0'
, ipod: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
, 'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3': {
ios: true
, version: '3.0'
, ipod: true
, mobile: true
, webkit: true
, safari: true
, c: true
}
} }
, 'Internet Explorer': { , 'Internet Explorer': {
'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MAARJS; rv:11.0) like Gecko': { 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MAARJS; rv:11.0) like Gecko': {
@ -588,148 +739,6 @@ module.exports.useragents = {
, x: true , x: true
} }
} }
, iPhone: {
'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11B554a': {
ios: true
, osversion: '7.0.4'
, iphone: true
, mobile: true
, webkit: true
, a: true
}
, 'Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5': {
ios: true
, osversion: '4.3.2'
, version: '5.0'
, iphone: true
, mobile: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3': {
ios: true
, version: '3.0'
, iphone: true
, mobile: true
, webkit: true
, x: true
}
, 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d Safari/6531.22.7': {
ios: true
, osversion: '4.1'
, version: '4.0'
, iphone: true
, mobile: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_2; en-gb) AppleWebKit/526+ (KHTML, like Gecko) Version/3.1 iPhone': {
ios: true
, version: '3.1'
, iphone: true
, mobile: true
, webkit: true
, x: true
}
, 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A344 Safari/601.1': {
ios: true
, osversion: '9.0'
, version: '9.0'
, iphone: true
, mobile: true
, webkit: true
, a: true
}
}
, iPad: {
'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53': {
ios: true
, osversion: '7.0.4'
, name: 'iPad'
, version: '7.0'
, ipad: true
, tablet: true
, webkit: true
, a: true
}
, 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25': {
ios: true
, osversion: '6.0'
, name: 'iPad'
, version: '6.0'
, ipad: true
, tablet: true
, webkit: true
, a: true
}
, 'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3': {
ios: true
, osversion: '5.1'
, name: 'iPad'
, version: '5.1'
, ipad: true
, tablet: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5': {
ios: true
, osversion: '4.3.2'
, name: 'iPad'
, version: '5.0'
, ipad: true
, tablet: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; es-es) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B360 Safari/531.21.10': {
ios: true
, osversion: '3.2'
, name: 'iPad'
, version: '4.0'
, ipad: true
, tablet: true
, webkit: true
, c: true
}
}
, iPod: {
'Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53': {
ios: true
, osversion: '7.0.3'
, version: '7.0'
, ipod: true
, mobile: true
, webkit: true
, a: true
}
, 'Mozilla/5.0 (iPod; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3': {
ios: true
, osversion: '5.1'
, version: '5.1'
, ipod: true
, mobile: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5': {
ios: true
, osversion: '4.3.3'
, version: '5.0'
, ipod: true
, mobile: true
, webkit: true
, c: true
}
, 'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3': {
ios: true
, version: '3.0'
, ipod: true
, mobile: true
, webkit: true
, x: true
}
}
, BlackBerry: { , BlackBerry: {
'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+': { 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+': {
blackberry: true blackberry: true