Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.3.3 to 1.4.0

.travis.yml

3

lib/detectBrowser.js
module.exports = function detectBrowser(userAgentString) {
var browsers = [
[ 'edge', /Edge\/([0-9\._]+)/ ],
[ 'chrome', /Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/ ],
[ 'chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/ ],
[ 'firefox', /Firefox\/([0-9\.]+)(?:\s|$)/ ],
[ 'opera', /Opera\/([0-9\.]+)(?:\s|$)/ ],
[ 'opera', /OPR\/([0-9\.]+)(:?\s|$)$/ ],
[ 'ie', /Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/ ],

@@ -8,0 +9,0 @@ [ 'ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/ ],

{
"name": "detect-browser",
"version": "1.3.3",
"version": "1.4.0",
"description": "Unpack a browser type and version from the useragent string",

@@ -44,2 +44,2 @@ "main": "index.js",

}
}
}

@@ -13,3 +13,3 @@ # detect-browser

[![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/dominictarr/stability#stable)
[![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/dominictarr/stability#stable) [![Build Status](https://api.travis-ci.org/DamonOehlman/detect-browser.svg?branch=master)](https://travis-ci.org/DamonOehlman/detect-browser) [![bitHound Score](https://www.bithound.io/github/DamonOehlman/detect-browser/badges/score.svg)](https://www.bithound.io/github/DamonOehlman/detect-browser)

@@ -30,3 +30,3 @@ ## Example Usage

Copyright (c) 2014 Damon Oehlman <damon.oehlman@gmail.com>
Copyright (c) 2016 Damon Oehlman <damon.oehlman@gmail.com>

@@ -33,0 +33,0 @@ Permission is hereby granted, free of charge, to any person obtaining

@@ -80,2 +80,7 @@ var test = require('tape');

assertAgentString(t,
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36 OPR/38.0.2220.31',
{ name: 'opera', version: '38.0.2220' }
);
t.end();

@@ -82,0 +87,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc