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

Fix mobile Opera's version detection

refers to #158
This commit is contained in:
Denis Demchenko 2016-09-19 22:55:05 +03:00
parent d5daa10f01
commit 27c7f5b294
2 changed files with 28 additions and 1 deletions

View File

@ -49,12 +49,20 @@
, xbox = /xbox/i.test(ua) , xbox = /xbox/i.test(ua)
, result , result
if (/opera|opr|opios/i.test(ua)) { if (/opera/i.test(ua)) {
// an old Opera
result = { result = {
name: 'Opera' name: 'Opera'
, opera: t , opera: t
, version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
} }
} else if (/opr|opios/i.test(ua)) {
// a new Opera
result = {
name: 'Opera'
, opera: t
, version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier
}
} }
else if (/SamsungBrowser/i.test(ua)) { else if (/SamsungBrowser/i.test(ua)) {
result = { result = {

View File

@ -308,6 +308,25 @@ module.exports.useragents = {
, linux: true , linux: true
, c: true , c: true
} }
, 'Mozilla/5.0 (iPod touch; CPU iPhone OS 9_3_4 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) OPiOS/14.0.0.104835 Mobile/13G35 Safari/9537.53': {
opera: true
, version: '14.0'
, mobile: true
, ipod: true
, ios: true
, a: true
, osversion: '9.3.4'
, webkit: true
}
, 'Mozilla/5.0 (Linux; U; Android 6.0; R1 HD Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Mobile Safari/537.36 OPR/18.0.2254.106542': {
opera: true
, version: '18.0'
, blink: true
, mobile: true
, android: true
, a: true
, osversion: '6.0'
}
} }
, 'Opera Coast': { , 'Opera Coast': {
'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Coast/5.02.99991 Mobile/13E238 Safari/7534.48.3': { 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Coast/5.02.99991 Mobile/13E238 Safari/7534.48.3': {