From 7dd4afb9445b9051ddb5c185df24ad579e910651 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 4 May 2017 13:52:45 -0500 Subject: [PATCH] Update browser-detection lib (#36) --- lib/device.js | 11 +++-------- package.json | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/device.js b/lib/device.js index 348fc3c..de6647d 100644 --- a/lib/device.js +++ b/lib/device.js @@ -3,23 +3,18 @@ var UA = navigator.userAgent; var isAndroid = require('browser-detection/is-android'); +var isChrome = require('browser-detection/is-chrome'); var isIos = require('browser-detection/is-ios'); var isIE9 = require('browser-detection/is-ie9'); -var CHROME_REGEX = /Chrome/; - -function _isChrome(ua) { - return CHROME_REGEX.test(ua || UA); -} - function _isOldSamsungBrowserOrSamsungWebview(ua) { - return !_isChrome(ua) && ua.indexOf('Samsung') > -1; + return !isChrome(ua) && ua.indexOf('Samsung') > -1; } function isAndroidChrome(uaArg) { var ua = uaArg || UA; - return isAndroid(ua) && _isChrome(ua); + return isAndroid(ua) && isChrome(ua); } function isSamsungBrowser(ua) { diff --git a/package.json b/package.json index f05f1c8..d502445 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "publish:demo": "./publish-gh-pages.sh" }, "dependencies": { - "browser-detection": "braintree/browser-detection#1.0.0" + "browser-detection": "braintree/browser-detection#1.1.0" }, "devDependencies": { "browserify": "13.0.1",