🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

detect-browser

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-browser - npm Package Compare versions

Comparing version

to
1.7.0

8

browser.js
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\._]+)/ ],

4

package.json
{
"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();
});