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

Merge branch 'vivaldi-support'

This commit is contained in:
Ivan Carosati 2015-12-07 14:55:28 -05:00
commit bf495e8331
3 changed files with 27 additions and 2 deletions

View File

@ -32,6 +32,7 @@ if (bowser.msie && bowser.version <= 6) {
* Bada browser as `bada`[`webkit`] * Bada browser as `bada`[`webkit`]
* Tizen browser as `tizen`[`webkit`] * Tizen browser as `tizen`[`webkit`]
* Sailfish browser as `sailfish`[`gecko`] * Sailfish browser as `sailfish`[`gecko`]
* Vivaldi browser as `vivaldi`[`webkit`]
For all detected browsers the browser version is set in the `version` field. For all detected browsers the browser version is set in the `version` field.

View File

@ -65,14 +65,23 @@
, msie: t , msie: t
, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
} }
} else if (chromeBook) { }
else if (/vivaldi/i.test(ua)) {
result = {
name: 'Vivaldi'
, vivaldi: t
, version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (chromeBook) {
result = { result = {
name: 'Chrome' name: 'Chrome'
, chromeBook: t , chromeBook: t
, chrome: t , chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
} }
} else if (/chrome.+? edge/i.test(ua)) { }
else if (/chrome.+? edge/i.test(ua)) {
result = { result = {
name: 'Microsoft Edge' name: 'Microsoft Edge'
, msedge: t , msedge: t
@ -241,6 +250,7 @@
(result.chrome && result.version >= 20) || (result.chrome && result.version >= 20) ||
(result.firefox && result.version >= 20.0) || (result.firefox && result.version >= 20.0) ||
(result.safari && result.version >= 6) || (result.safari && result.version >= 6) ||
(result.vivaldi && result.version >= 1) ||
(result.opera && result.version >= 10.0) || (result.opera && result.version >= 10.0) ||
(result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) ||
(result.blackberry && result.version >= 10.1) (result.blackberry && result.version >= 10.1)

View File

@ -964,6 +964,20 @@ module.exports.useragents = {
, x: true , x: true
} }
} }
, Vivaldi: {
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36 Vivaldi/1.0.303.52': {
vivaldi: true,
version: '1.0',
webkit: true,
a: true
},
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36 Vivaldi/1.0.303.52': {
vivaldi: true,
version: '1.0',
webkit: true,
a: true
}
}
, Generic: { , Generic: {
'Generic/2.15 libww': { 'Generic/2.15 libww': {
name: 'Generic' name: 'Generic'