From 691626b700fd384c19a8b06b24a45fdbbd2e4f44 Mon Sep 17 00:00:00 2001 From: monnef Date: Fri, 16 Sep 2016 07:10:45 +0200 Subject: [PATCH 1/5] Updated README - extended text for check function. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f17f21a..c35ac70 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Use it to get object with detected flags of your current browser. Use it to get object with detected flags from User Agent string. ### bowser.check(minVersions`:Object`, strictMode`:Boolean`, [ua]`:String`)`:Boolean` -Use it to check if browser supported. +Use it to check if browser is supported. In default non-strict mode any browser family not present in `minVersions` will pass the check (like Chrome in the third call in the sample bellow). When strict mode is enabled then any not specified browser family in `minVersions` will cause `check` to return `false` (in the sample it is the fourth call, the last one). ``` js /** From 951b13ca6db2fe0579a72e3cfd0e8fb4acbb3ee2 Mon Sep 17 00:00:00 2001 From: crush Date: Mon, 19 Sep 2016 12:31:31 +0300 Subject: [PATCH 2/5] fix(typings): add mobile and tablet flags --- typings.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typings.d.ts b/typings.d.ts index 7cb0cb1..5b2bf20 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -26,6 +26,8 @@ export const silk: boolean export const tizen: boolean export const webkit: boolean export const webos: boolean +export const mobile: boolean +export const tablet: boolean // operating systems export const chromeos: boolean From 27c7f5b294eee2f7c829f222beb41643ca43fc5b Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Mon, 19 Sep 2016 22:55:05 +0300 Subject: [PATCH 3/5] Fix mobile Opera's version detection refers to #158 --- src/bowser.js | 10 +++++++++- src/useragents.js | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 9062bf8..d69268f 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -49,12 +49,20 @@ , xbox = /xbox/i.test(ua) , result - if (/opera|opr|opios/i.test(ua)) { + if (/opera/i.test(ua)) { + // an old Opera result = { name: 'Opera' , opera: t , 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)) { result = { diff --git a/src/useragents.js b/src/useragents.js index 2303d08..e30aea3 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -308,6 +308,25 @@ module.exports.useragents = { , linux: 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': { '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': { From 5df200ee0bcc46f8a0f19b75436685953bcb8fba Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Mon, 19 Sep 2016 23:01:57 +0300 Subject: [PATCH 4/5] Bump version --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 6dee789..99cae6d 100644 --- a/bower.json +++ b/bower.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "1.4.1", + "version": "1.4.6", "homepage": "https://github.com/ded/bowser", "scripts": [ "src/bowser.js" diff --git a/package.json b/package.json index 0eb3878..dead1b9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "1.4.5", + "version": "1.4.6", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./src/bowser.js", From 9ea294b9733ab87be305668a574f5ad3e3cda5ec Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Mon, 19 Sep 2016 23:06:24 +0300 Subject: [PATCH 5/5] Write changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db71c87..d96d959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Bowser Changelog +### 1.4.6 (September 19, 2016) +- [FIX] Fix mobile Opera's version detection on Android +- [FIX] Fix typescript typings — add `mobile` and `tablet` flags +- [DOC] Fix description of `bowser.check` + ### 1.4.5 (August 30, 2016) - [FIX] Add support of Samsung Internet for Android