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

Merge branch 'hotfix/1.9.4' into production

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

View File

@ -1,5 +1,11 @@
# 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)
- [FIX] Fix `typings.d.ts` — add `ipad`, `iphone`, `ipod` flags to the interface

View File

@ -40,7 +40,7 @@ bowser.check({msie: "9.0"}); // false
/**
* specific user agent
*/
*/
bowser.check({chrome: "45"}, window.navigator.userAgent); // true
/**
@ -134,6 +134,7 @@ If detected, one of these flags may be set to true. The rendering engine flag i
* `vivaldi` — [`blink`]
* `sleipnir` — [`blink`]
* `kMeleon` — [`gecko`]
* `whale` — [`blink`]
For all detected browsers the browser version is set in the `version` field.

View File

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

View File

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

View File

@ -36,7 +36,7 @@
, silk = /silk/i.test(ua)
, sailfish = /sailfish/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)
, samsungBrowser = /SamsungBrowser/i.test(ua)
, windows = !windowsphone && /windows/i.test(ua)
@ -71,6 +71,20 @@
, 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)) {
result = {
name: 'Opera Coast'
@ -78,6 +92,13 @@
, 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)) {
result = {
name: 'Yandex Browser'
@ -424,6 +445,9 @@
(result.vivaldi && result.version >= 1.0) ||
(result.chrome && result.version >= 20) ||
(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.safari && result.version >= 6) ||
(result.opera && result.version >= 10.0) ||

View File

@ -1230,6 +1230,14 @@ module.exports.useragents = {
, mobile: 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: {
'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
, 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
}
}
};

3
typings.d.ts vendored
View File

@ -62,6 +62,7 @@ declare namespace bowser {
vivaldi: boolean;
sleipnir: boolean;
kMeleon: boolean;
whale: boolean;
}
export interface IBowserEngines {
@ -90,7 +91,7 @@ declare namespace bowser {
version: string|number;
/** Name for this operating system. E.g. 'macOS' */
osname: string;
/** Version number for this operating system. E.g. '10.12.6' */
/** Version number for this operating system. E.g. '10.12.6' */
osversion: string|number;
}