From 6715bb2b08ae487eb703aac2a180b3d1b63feb47 Mon Sep 17 00:00:00 2001 From: kerbyfc Date: Thu, 16 Jun 2016 12:06:15 +0300 Subject: [PATCH 01/22] Implement isUnsupportedBrowser method See http://jsbin.com/vohahaciku/1/edit?js,console --- src/bowser.js | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/bowser.js b/src/bowser.js index d966269..2e88be1 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -406,6 +406,86 @@ } return false; } + + /** + * Get version precisions count + * @example + * getVersionPrecision("1.10.3") // 3 + * @param {string} version + * @return {number} + */ + function getVersionPrecision(version) { + return version.split(".").length; + } + + /** + * Calculate browser version weight + * @see http://jsbin.com/vohahaciku/1/edit?js,console + * + * @example + * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 + * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 + * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 + * compareVersions(['1.10.2.1', '1.0800.2']); // -1 + */ + function compareVersions(versions) { + // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 + var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); + var chunks = versions.map(function (version) { + var delta = precision - getVersionPrecision(version); + return (version + new Array(delta + 1).join(".0")) // 2) "9" -> "9.0" (for precision = 2) + .split(".") + .map(function (chunk) { return new Array(10 - chunk.length).join("0") + chunk; }) + .reverse(); + }); + // iterate in reverse order by reversed chunks array + while (--precision >= 0) { + // 5) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + if (chunks[0][precision] > chunks[1][precision]) { + return 1; + } + else if (chunks[0][precision] === chunks[1][precision]) { + if (precision === 0) { + // all version chunks are same + return 0; + } + } + else { + return -1; + } + } + } + + /** + * Check if browser is unsupported + * @example + * bowser.check({ + * msie: "10", + * firefox: "23", + * chrome: "29", + * safari: "5.1", + * opera: "16", + * phantom: "534" + * }); + */ + function isUnsupportedBrowser(minVersions, strictMode) { + if (strictMode === void 0) { strictMode = false; } + var version = "" + bowser.version; + for (var browser in minVersions) { + if (minVersions.hasOwnProperty(browser)) { + if (bowser[browser]) { + // browser version and min supported version. + if (compareVersions([version, minVersions[browser]]) < 0) { + return true; // unsupported + } + } + } + } + return true && !strictMode; // not found + } + + bowser.isUnsupportedBrowser = isUnsupportedBrowser; + bowser.compareVersions = compareVersions; /* * Set our detect method to the main bowser object so we can From 609f3d27bf3a5b0c0b0e1c1bdd34720e7e48174a Mon Sep 17 00:00:00 2001 From: kerbyfc Date: Thu, 16 Jun 2016 12:18:35 +0300 Subject: [PATCH 02/22] Add test for bowser.compareVersions --- test/test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test.js b/test/test.js index c11e035..c78dcb2 100644 --- a/test/test.js +++ b/test/test.js @@ -73,3 +73,25 @@ for (g in allUserAgents) { (function(group, userAgents) { }) })(g, allUserAgents[g])} + +var comparisionsTasks = [ + ['9.0', '10', -1], + ['11', '10', 1], + ['1.10.2.1', '1.8.2.1.90', 1], + ['1.010.2.1', '1.08.2.1.90', 1], + ['1.10.2.1', '1.10.2.1', 0], + ['1.10.2.1', '1.0800.2', -1], +]; + +describe('Browser versions comparision', function() { + + for(g in comparisionsTasks) { + var task = comparisionsTasks[g], + version = task[0], + version2 = task[1], + matching = task[2] === 0 ? ' == ' : (task[2] > 0) ? ' > ' : ' < '; + it('version ' + version + ' should be' + matching + 'version ' + version2, function(){ + assert.equal(browser.compareVersions([version, version2]), task[2]); + }) + } +}); From 57a45d1dee433ffbf775c2a53e9b200ec0a59e2c Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:04:01 +0300 Subject: [PATCH 03/22] fix comments --- src/bowser.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 2e88be1..e338617 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -406,7 +406,7 @@ } return false; } - + /** * Get version precisions count * @example @@ -427,6 +427,9 @@ * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 + * + * @param {Array} versions versions to compare + * @return {Number} comparision result */ function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 @@ -467,6 +470,10 @@ * opera: "16", * phantom: "534" * }); + * + * @param {Object} minVersions minVersions map of minimal version to browser + * @param {Boolean} strictMode flag to return false if browser wasn't found in map + * @return {Boolean} */ function isUnsupportedBrowser(minVersions, strictMode) { if (strictMode === void 0) { strictMode = false; } From c9eed902e3b4b4142660b87648f62ae61761e05e Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:04:57 +0300 Subject: [PATCH 04/22] add check method --- src/bowser.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index e338617..59f1666 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -461,8 +461,9 @@ /** * Check if browser is unsupported + * * @example - * bowser.check({ + * bowser.isUnsupportedBrowser({ * msie: "10", * firefox: "23", * chrome: "29", @@ -491,6 +492,17 @@ return true && !strictMode; // not found } + /** + * Check if browser is supported + * + * @param {Object} minVersions map of minimal version to browser + * @param {Boolean} strictMode flag to return false if browser wasn't found in map + * @return {Boolean} + */ + function check(minVersions, strictMode) { + return !isUnsupportedBrowser(minVersions, strictMode); + } + bowser.isUnsupportedBrowser = isUnsupportedBrowser; bowser.compareVersions = compareVersions; From ceb98fd099c858d885332a4034707d40be7a7e0c Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:20:30 +0300 Subject: [PATCH 05/22] add tests for alpha, beta, rc --- test/test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test.js b/test/test.js index c78dcb2..13336c8 100644 --- a/test/test.js +++ b/test/test.js @@ -81,6 +81,12 @@ var comparisionsTasks = [ ['1.010.2.1', '1.08.2.1.90', 1], ['1.10.2.1', '1.10.2.1', 0], ['1.10.2.1', '1.0800.2', -1], + ['1.0.0-alpha', '1.0.0-alpha.1', -1], + ['1.0.0-alpha.1', '1.0.0-alpha.beta', -1], + ['1.0.0-alpha.beta', '1.0.0-beta', -1], + ['1.0.0-beta', '1.0.0-beta.2', -1], + ['1.0.0-beta.11', '1.0.0-rc.1', -1], + ['1.0.0-rc.1', '1.0.0', -1] ]; describe('Browser versions comparision', function() { From b51a35e0065cfbe95596454125a84fed67e55af9 Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:38:25 +0300 Subject: [PATCH 06/22] add Array::map polyfill to compatible with es4 --- src/bowser.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/bowser.js b/src/bowser.js index 59f1666..81d1c6c 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -418,6 +418,23 @@ return version.split(".").length; } + /** + * Array::map polyfill + * @param {Array} arr + * @param {Function} iterator + * @return {Array} + */ + function map(arr, iterator) { + var result = [], i; + if (Array.prototype.map) { + return Array.prototype.map.call(arr, iterator); + } + for (i = 0; i < arr.length; i++) { + result = iterator(arr[i]); + } + return result; + } + /** * Calculate browser version weight * @see http://jsbin.com/vohahaciku/1/edit?js,console From c77cf0ae1b124b79de2059ac3b9781a67692283d Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:39:05 +0300 Subject: [PATCH 07/22] refactoring: use map instead of direct Array::map --- src/bowser.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 81d1c6c..8d2dee4 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -451,16 +451,21 @@ function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); - var chunks = versions.map(function (version) { - var delta = precision - getVersionPrecision(version); - return (version + new Array(delta + 1).join(".0")) // 2) "9" -> "9.0" (for precision = 2) - .split(".") - .map(function (chunk) { return new Array(10 - chunk.length).join("0") + chunk; }) - .reverse(); + var chunks = map(versions, function (version) { + var delta = precision - getVersionPrecision(version); + + // 2) "9" -> "9.0" (for precision = 2) + version = version + new Array(delta + 1).join(".0"); + + // 3) "9.0" -> [""000000000"", "000000009"] + return map(version.split("."), function (chunk) { + return new Array(20 - chunk.length).join("0") + chunk; + }).reverse(); }); + // iterate in reverse order by reversed chunks array while (--precision >= 0) { - // 5) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) if (chunks[0][precision] > chunks[1][precision]) { return 1; } From 24b91a4dab87ce031274a3bbead2d2a3ea27f26c Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:41:21 +0300 Subject: [PATCH 08/22] fix comments --- src/bowser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 8d2dee4..1bb343d 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -409,8 +409,10 @@ /** * Get version precisions count + * * @example * getVersionPrecision("1.10.3") // 3 + * * @param {string} version * @return {number} */ @@ -420,6 +422,7 @@ /** * Array::map polyfill + * * @param {Array} arr * @param {Function} iterator * @return {Array} @@ -457,7 +460,7 @@ // 2) "9" -> "9.0" (for precision = 2) version = version + new Array(delta + 1).join(".0"); - // 3) "9.0" -> [""000000000"", "000000009"] + // 3) "9.0" -> ["000000000"", "000000009"] return map(version.split("."), function (chunk) { return new Array(20 - chunk.length).join("0") + chunk; }).reverse(); From a5306640fa91411443760592a7d041791c5fd777 Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:41:53 +0300 Subject: [PATCH 09/22] small fixes --- test/test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 13336c8..e8cb04a 100644 --- a/test/test.js +++ b/test/test.js @@ -90,7 +90,6 @@ var comparisionsTasks = [ ]; describe('Browser versions comparision', function() { - for(g in comparisionsTasks) { var task = comparisionsTasks[g], version = task[0], @@ -98,6 +97,6 @@ describe('Browser versions comparision', function() { matching = task[2] === 0 ? ' == ' : (task[2] > 0) ? ' > ' : ' < '; it('version ' + version + ' should be' + matching + 'version ' + version2, function(){ assert.equal(browser.compareVersions([version, version2]), task[2]); - }) + }); } }); From ec7531e8cb31475e2f13be896138a20ab1d0d064 Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:43:48 +0300 Subject: [PATCH 10/22] remove @see jsbin comment --- src/bowser.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 1bb343d..9c689bd 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -440,7 +440,6 @@ /** * Calculate browser version weight - * @see http://jsbin.com/vohahaciku/1/edit?js,console * * @example * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 From 43ac868d84750c175a86e4c66362b89fe7d960b8 Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:45:24 +0300 Subject: [PATCH 11/22] export bowser.check --- src/bowser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bowser.js b/src/bowser.js index 9c689bd..83e6396 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -529,6 +529,7 @@ bowser.isUnsupportedBrowser = isUnsupportedBrowser; bowser.compareVersions = compareVersions; + bowser.check = check; /* * Set our detect method to the main bowser object so we can From c30f6d41d98c987eaead133d1362be2c0dc29f3d Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 13:49:18 +0300 Subject: [PATCH 12/22] fix isUnsupportedBrowser documentation --- src/bowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 83e6396..ab558fc 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -496,7 +496,7 @@ * phantom: "534" * }); * - * @param {Object} minVersions minVersions map of minimal version to browser + * @param {Object} minVersions map of minimal version to browser * @param {Boolean} strictMode flag to return false if browser wasn't found in map * @return {Boolean} */ From 134aeede535187e83d614d6e409dad04e7b17c5c Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 16:01:45 +0300 Subject: [PATCH 13/22] add support for optional ua parameter --- src/bowser.js | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index ab558fc..1f96a1d 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -497,15 +497,30 @@ * }); * * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} strictMode flag to return false if browser wasn't found in map + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map + * @param {String} [ua] user agent string * @return {Boolean} */ - function isUnsupportedBrowser(minVersions, strictMode) { - if (strictMode === void 0) { strictMode = false; } - var version = "" + bowser.version; + function isUnsupportedBrowser(minVersions, strictMode, ua) { + var _bowser = bowser; + + // make strictMode param optional with ua param usage + if (typeof strictMode === 'string') { + ua = strictMode; + strictMode = void(0); + } + + if (strictMode === void(0)) { + strictMode = false; + } + if (ua) { + _bowser = detect(ua); + } + + var version = "" + _bowser.version; for (var browser in minVersions) { if (minVersions.hasOwnProperty(browser)) { - if (bowser[browser]) { + if (_bowser[browser]) { // browser version and min supported version. if (compareVersions([version, minVersions[browser]]) < 0) { return true; // unsupported @@ -513,14 +528,14 @@ } } } - return true && !strictMode; // not found + return strictMode; // not found } /** * Check if browser is supported * * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} strictMode flag to return false if browser wasn't found in map + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map * @return {Boolean} */ function check(minVersions, strictMode) { From 93c381f7e8ae270d3330f0444a288f337680251a Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 16:02:07 +0300 Subject: [PATCH 14/22] add tests for isUnsupportedBrowser & check methods --- test/test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/test.js b/test/test.js index e8cb04a..780e044 100644 --- a/test/test.js +++ b/test/test.js @@ -100,3 +100,31 @@ describe('Browser versions comparision', function() { }); } }); + +describe('Unsupported browser check', function() { + + before(function() { + this.ie10_6 = "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0"; + }); + + it('should be passed by #isUnsupportedBrowser for IE10.6 and for IE10 miminal version specified', function() { + var unsupported = browser.isUnsupportedBrowser({msie: "10"}, this.ie10_6); + assert.equal(unsupported, false); + }); + + it('should NOT be passed by #check for IE10.6 and for IE11 miminal version specified', function() { + var supported = browser.check({msie: "11"}, this.ie10_6); + assert.equal(supported, false); + }); + + it('should be passed by #check for IE10.6 when version was not specified', function() { + var supported = browser.check({}, this.ie10_6); + assert.equal(supported, true); + }); + + it('should be NOT passed by #check for IE10.6 when version was not specified in strict mode', function() { + var supported = browser.check({}, true, this.ie10_6); + assert.equal(supported, false); + }); + +}) From c029b5113e491acbe43ff17a7d1bf16e03c22dde Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 16 Jun 2016 16:04:18 +0300 Subject: [PATCH 15/22] fix test name --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 780e044..cce4198 100644 --- a/test/test.js +++ b/test/test.js @@ -122,7 +122,7 @@ describe('Unsupported browser check', function() { assert.equal(supported, true); }); - it('should be NOT passed by #check for IE10.6 when version was not specified in strict mode', function() { + it('should NOT be passed by #check for IE10.6 when version was not specified in strict mode', function() { var supported = browser.check({}, true, this.ie10_6); assert.equal(supported, false); }); From b84c5c09fbac0de2bd723a5bfc7a1c90b499737b Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Tue, 28 Jun 2016 11:16:11 +0300 Subject: [PATCH 16/22] fix mistype --- src/bowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 1f96a1d..c76c4cc 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -448,7 +448,7 @@ * compareVersions(['1.10.2.1', '1.0800.2']); // -1 * * @param {Array} versions versions to compare - * @return {Number} comparision result + * @return {Number} comparison result */ function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 From e778c51cfc3560cb49757c2df77c33c554009a82 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Tue, 28 Jun 2016 11:19:55 +0300 Subject: [PATCH 17/22] add prepublish hook --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index dbceb85..44a8051 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "test": "test" }, "scripts": { - "test": "make test" + "test": "make test", + "prepublish": "make boosh" }, "license": "MIT" } From ab46669db85b63809232993986f046d1d04bafdb Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Tue, 28 Jun 2016 11:32:54 +0300 Subject: [PATCH 18/22] add changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3c375db --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Bowser Changelog + + +### 1.4.0 (June 28, 2016) + +- [FEATURE] Add `bowser.compareVersions` method +- [FEATURE] Add `bowser.isUnsupportedBrowser` method +- [FEATURE] Add `bowser.check` method +- [DOC] Changelog started From c0106d31f2b77e8dba4a242729ddf37aa45dad14 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 30 Jun 2016 20:52:55 +0300 Subject: [PATCH 19/22] add API section --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index ba35d58..c539419 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,44 @@ Also you can download minified file from [the release page](https://github.com/d ## 1.0.0 breaking changes `browser = require('bowser').browser;` becomes `browser = require('bowser');` +--- + +## API + +### bowser()`:Object` +Use it to get object with detected flags of your current browser. + +### bowser._detect(ua `:String`)`:Object` +Use it to get object with detected flags from User Agent string. + +### bowser.check(minVersions`:Object`, strictMode`:Boolean`)`:Boolean` +Use it to check if browser supported. + +``` +browser.check({msie: "11"}, window.navigator.userAgent); +// true / false +``` + +### bowser.compareVersions(versions`:Array`)`:Number` +Use it to compare two versions. + +``` +browser.compareVersions(['9.0', '10']); +// -1 +``` + +### bowser.isUnsupportedBrowser(minVersions`:Object`, [strictMode]`:Boolean`, [ua]`:string`)`:Boolean` +Use it to check if browser is unsupported. + +``` +browser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); +// true / false +``` + +See more examples in [tests](test/test.js). + +--- + ## Bowser Flags Your mileage may vary, but these flags should be set. See Contributing below. From 5bf468659a3729043d0928a2cd8b78d7684a2880 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 30 Jun 2016 21:12:44 +0300 Subject: [PATCH 20/22] fix type detection of chromium browsers fix #142 --- src/bowser.js | 2 ++ src/useragents.js | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index c76c4cc..190f457 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -377,6 +377,7 @@ (result.opera && result.version >= 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || (result.blackberry && result.version >= 10.1) + || (result.chromium && result.version >= 20) ) { result.a = t; } @@ -386,6 +387,7 @@ (result.safari && result.version < 6) || (result.opera && result.version < 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] < 6) + || (result.chromium && result.version < 20) ) { result.c = t } else result.x = t diff --git a/src/useragents.js b/src/useragents.js index 0ffea38..dd7fb25 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -1245,7 +1245,14 @@ module.exports.useragents = { , chromium: true , version: '35.0' , blink: true - , x: true + , a: true + } + , 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/50.0.2661.102 Chrome/50.0.2661.102 Safari/537.36': { + chromium: true + , a: true + , version: '50.0' + , linux: true + , blink: true } } , 'SlimerJS' : { From acc74b461cd60c0a210a4d634c26dfb6e898b4be Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 30 Jun 2016 21:13:43 +0300 Subject: [PATCH 21/22] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44a8051..aabb3c6 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "1.3.0", + "version": "1.4.0", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./src/bowser.js", From 54166936e3caf546aa30d87b5140fa1cf549981e Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 30 Jun 2016 21:15:19 +0300 Subject: [PATCH 22/22] write changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c375db..15ea258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,5 @@ - [FEATURE] Add `bowser.isUnsupportedBrowser` method - [FEATURE] Add `bowser.check` method - [DOC] Changelog started +- [DOC] Add API section to README +- [FIX] Fix detection of browser type (A/C/X) for Chromium