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

Merge tag '1.9.4'

no message
This commit is contained in:
Denis Demchenko 2018-06-28 21:32:37 +03:00
commit 041fe77ab4
7 changed files with 80 additions and 6 deletions

View File

@ -1,5 +1,11 @@
# Bowser Changelog # Bowser Changelog
### 1.9.4 (June 28, 2018)
- [FIX] Fix NAVER Whale browser detection (#220)
- [FIX] Fix MZ Browser browser detection (#219)
- [FIX] Fix Firefox Focus browser detection (#191)
- [FIX] Fix webOS browser detection (#186)
### 1.9.3 (March 12, 2018) ### 1.9.3 (March 12, 2018)
- [FIX] Fix `typings.d.ts` — add `ipad`, `iphone`, `ipod` flags to the interface - [FIX] Fix `typings.d.ts` — add `ipad`, `iphone`, `ipod` flags to the interface

View File

@ -134,6 +134,7 @@ If detected, one of these flags may be set to true. The rendering engine flag i
* `vivaldi` — [`blink`] * `vivaldi` — [`blink`]
* `sleipnir` — [`blink`] * `sleipnir` — [`blink`]
* `kMeleon` — [`gecko`] * `kMeleon` — [`gecko`]
* `whale` — [`blink`]
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

@ -11,7 +11,7 @@
"ender", "ender",
"sniff" "sniff"
], ],
"version": "1.9.3", "version": "1.9.4",
"homepage": "https://github.com/lancedikson/bowser", "homepage": "https://github.com/lancedikson/bowser",
"scripts": [ "scripts": [
"src/bowser.js" "src/bowser.js"

View File

@ -1,6 +1,6 @@
{ {
"name": "bowser", "name": "bowser",
"version": "1.9.3", "version": "1.9.4",
"description": "Lightweight browser detector", "description": "Lightweight browser detector",
"keywords": [ "keywords": [
"browser", "browser",

View File

@ -36,7 +36,7 @@
, silk = /silk/i.test(ua) , silk = /silk/i.test(ua)
, sailfish = /sailfish/i.test(ua) , sailfish = /sailfish/i.test(ua)
, tizen = /tizen/i.test(ua) , tizen = /tizen/i.test(ua)
, webos = /(web|hpw)os/i.test(ua) , webos = /(web|hpw)(o|0)s/i.test(ua)
, windowsphone = /windows phone/i.test(ua) , windowsphone = /windows phone/i.test(ua)
, samsungBrowser = /SamsungBrowser/i.test(ua) , samsungBrowser = /SamsungBrowser/i.test(ua)
, windows = !windowsphone && /windows/i.test(ua) , windows = !windowsphone && /windows/i.test(ua)
@ -71,6 +71,20 @@
, version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)
} }
} }
else if (/Whale/i.test(ua)) {
result = {
name: 'NAVER Whale browser'
, whale: t
, version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/MZBrowser/i.test(ua)) {
result = {
name: 'MZ Browser'
, mzbrowser: t
, version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/coast/i.test(ua)) { else if (/coast/i.test(ua)) {
result = { result = {
name: 'Opera Coast' name: 'Opera Coast'
@ -78,6 +92,13 @@
, version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
} }
} }
else if (/focus/i.test(ua)) {
result = {
name: 'Focus'
, focus: t
, version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/yabrowser/i.test(ua)) { else if (/yabrowser/i.test(ua)) {
result = { result = {
name: 'Yandex Browser' name: 'Yandex Browser'
@ -424,6 +445,9 @@
(result.vivaldi && result.version >= 1.0) || (result.vivaldi && result.version >= 1.0) ||
(result.chrome && result.version >= 20) || (result.chrome && result.version >= 20) ||
(result.samsungBrowser && result.version >= 4) || (result.samsungBrowser && result.version >= 4) ||
(result.whale && compareVersions([result.version, '1.0']) === 1) ||
(result.mzbrowser && compareVersions([result.version, '6.0']) === 1) ||
(result.focus && compareVersions([result.version, '1.0']) === 1) ||
(result.firefox && result.version >= 20.0) || (result.firefox && result.version >= 20.0) ||
(result.safari && result.version >= 6) || (result.safari && result.version >= 6) ||
(result.opera && result.version >= 10.0) || (result.opera && result.version >= 10.0) ||

View File

@ -1230,6 +1230,14 @@ module.exports.useragents = {
, mobile: true , mobile: true
, x: true , x: true
} }
, 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 WebAppManager': {
osname: 'WebOS'
, blink: true
, webos: true
, mobile: true
, version: ''
, x: true
}
} }
, Android: { , Android: {
'Mozilla/5.0 (Linux; U; Android 4.4.2; de-de; Nexus 7 Build/KOT49H) AppleWebKit/537.16 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.16': { 'Mozilla/5.0 (Linux; U; Android 4.4.2; de-de; Nexus 7 Build/KOT49H) AppleWebKit/537.16 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.16': {
@ -1573,5 +1581,39 @@ module.exports.useragents = {
, a: true , a: true
, blink: true , blink: true
} }
}, 'NAVER Whale browser' : {
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Whale/1.0.40.10 Safari/537.36': {
osname: 'macOS'
, whale: true
, mac: true
, osversion: '10.12.6'
, version: '1.0.40.10'
, blink: true
, a: true
}
} }
} , 'MZ Browser': {
'Mozilla/5.0 (Linux; U; Android 6.0; zh-CN; MZ-PRO 6 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 MZBrowser/6.9.511-2018012510 UWS/2.11.0.33 Mobile Safari/537.36': {
osname: 'Android'
, mzbrowser: true
, android: true
, mobile: true
, osversion: '6.0'
, version: '6.9.511'
, blink: true
, a: true
}
}
, 'Focus' : {
'Mozilla/5.0 (Linux; Android 7.1.1) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.2.1 Chrome/59.0.3071.125': {
osname: 'Android'
, focus: true
, android: true
, tablet: true
, osversion: '7.1.1'
, version: '1.2.1'
, blink: true
, a: true
}
}
};

1
typings.d.ts vendored
View File

@ -62,6 +62,7 @@ declare namespace bowser {
vivaldi: boolean; vivaldi: boolean;
sleipnir: boolean; sleipnir: boolean;
kMeleon: boolean; kMeleon: boolean;
whale: boolean;
} }
export interface IBowserEngines { export interface IBowserEngines {