From 7a8b91dc6f6bd3527edfbff29e5c3bdde96f02b7 Mon Sep 17 00:00:00 2001 From: kerbyfc Date: Mon, 29 Aug 2016 12:59:58 +0300 Subject: [PATCH 1/3] Improve the browser.check documentation --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0386ff3..5cf1a5f 100644 --- a/README.md +++ b/README.md @@ -28,18 +28,31 @@ 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`, [ua]`:String`)`:Boolean` +### bowser.check(minVersions`:Object`, [strictMode]`:Boolean`, [ua]`:String`)`:Boolean` Use it to check if browser supported. -``` -browser.check({msie: "11"}, window.navigator.userAgent); -// true / false +``` js +/** + * in case of using IE10 + */ +browser.check({msie: "11"}); // true +browser.check({msie: "9.0"}); // false + +/** + * specific user agent + */ +browser.check({chome: 45}, window.navigator.userAgent); // true + +/** + * but false in strict mode + */ +browesr.check({chome: 45}, true, window.navigator.userAgent); // false ``` ### bowser.compareVersions(versions`:Array`)`:Number` Use it to compare two versions. -``` +``` js browser.compareVersions(['9.0', '10']); // -1 ``` @@ -47,7 +60,7 @@ browser.compareVersions(['9.0', '10']); ### bowser.isUnsupportedBrowser(minVersions`:Object`, [strictMode]`:Boolean`, [ua]`:string`)`:Boolean` Use it to check if browser is unsupported. -``` +``` js browser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); // true / false ``` From 62ae9d6cbf8c73d4cde29765a8136fc42c7fd1c7 Mon Sep 17 00:00:00 2001 From: kerbyfc Date: Mon, 29 Aug 2016 13:02:00 +0300 Subject: [PATCH 2/3] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cf1a5f..baf21f9 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ browser.check({chome: 45}, window.navigator.userAgent); // true /** * but false in strict mode */ -browesr.check({chome: 45}, true, window.navigator.userAgent); // false +browser.check({chome: 45}, true, window.navigator.userAgent); // false ``` ### bowser.compareVersions(versions`:Array`)`:Number` From ab028b2529ede51229da0bba276ea8b62f0c0224 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Tue, 30 Aug 2016 00:00:14 +0300 Subject: [PATCH 3/3] fix typo in the README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chome → chrome --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index baf21f9..ddcf1d1 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,12 @@ browser.check({msie: "9.0"}); // false /** * specific user agent */ -browser.check({chome: 45}, window.navigator.userAgent); // true +browser.check({chrome: 45}, window.navigator.userAgent); // true /** * but false in strict mode */ -browser.check({chome: 45}, true, window.navigator.userAgent); // false +browser.check({chrome: 45}, true, window.navigator.userAgent); // false ``` ### bowser.compareVersions(versions`:Array`)`:Number`