detect-browser
Advanced tools
Comparing version 1.3.3 to 1.4.0
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 @@ }); |
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
9576
11
176