detect-browser
Advanced tools
Comparing version 1.6.2 to 1.7.0
var detectBrowser = require('./lib/detectBrowser'); | ||
module.exports = detectBrowser(navigator.userAgent); | ||
var agent; | ||
if (typeof navigator !== 'undefined' && navigator) { | ||
agent = navigator.userAgent; | ||
} | ||
module.exports = detectBrowser(agent); |
module.exports = function detectBrowser(userAgentString) { | ||
if (!userAgentString) return null; | ||
var browsers = [ | ||
@@ -3,0 +5,0 @@ [ 'edge', /Edge\/([0-9\._]+)/ ], |
{ | ||
"name": "detect-browser", | ||
"version": "1.6.2", | ||
"version": "1.7.0", | ||
"description": "Unpack a browser type and version from the useragent string", | ||
@@ -32,2 +32,2 @@ "main": "index.js", | ||
} | ||
} | ||
} |
@@ -146,1 +146,10 @@ var test = require('tape'); | ||
}); | ||
test('handles no browser', function(t) { | ||
assertAgentString(t, | ||
null, | ||
null | ||
); | ||
t.end(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11108
193