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

fix order: Chrome should be almost lowest, but before Safari

This commit is contained in:
Denis Demchenko 2016-05-08 15:08:19 +03:00
parent 251eca7ff0
commit d6fb6d5358

View File

@ -117,18 +117,11 @@
, version: edgeVersion , version: edgeVersion
} }
} }
else if (/vivaldi/i.test(ua)) { else if (/vivaldi/i.test(ua)) {
result = {
name: 'Vivaldi'
, vivaldi: t
, version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (/chrome|crios|crmo/i.test(ua)) {
result = { result = {
name: 'Chrome' name: 'Vivaldi'
, chrome: t , vivaldi: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
} }
} }
else if (sailfish) { else if (sailfish) {
@ -162,12 +155,6 @@
, version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
} }
} }
else if (android) {
result = {
name: 'Android'
, version: versionIdentifier
}
}
else if (/phantom/i.test(ua)) { else if (/phantom/i.test(ua)) {
result = { result = {
name: 'PhantomJS' name: 'PhantomJS'
@ -211,6 +198,19 @@
, version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
} }
} }
else if (/chrome|crios|crmo/i.test(ua)) {
result = {
name: 'Chrome'
, chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
}
}
else if (android) {
result = {
name: 'Android'
, version: versionIdentifier
}
}
else if (/safari|applewebkit/i.test(ua)) { else if (/safari|applewebkit/i.test(ua)) {
result = { result = {
name: 'Safari' name: 'Safari'