browser-info
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -89,2 +89,9 @@ /* globals navigator*/ | ||
} | ||
if (match[0] === 'Firefox') { | ||
match[0] = /waterfox/i.test(ua) | ||
? 'Waterfox' | ||
: match[0]; | ||
} | ||
return { | ||
@@ -91,0 +98,0 @@ name: match[0], |
{ | ||
"name": "browser-info", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Get browser info", | ||
@@ -5,0 +5,0 @@ "author": "Steve Lacy <me@slacy.me> (http://slacy.me)", |
@@ -1,2 +0,2 @@ | ||
#browser-info | ||
# browser-info | ||
[![Build Status](https://travis-ci.org/stevelacy/browser-info.png?branch=master)](https://travis-ci.org/stevelacy/browser-info) | ||
@@ -3,0 +3,0 @@ [![NPM version](https://badge.fury.io/js/browser-info.png)](http://badge.fury.io/js/browser-info) |
@@ -78,2 +78,26 @@ 'use strict'; | ||
it('should detect Firefox', function(done) { | ||
global.navigator = { | ||
userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0' | ||
}; | ||
should(info().name).equal('Firefox'); | ||
should(info().os).equal('Linux'); | ||
should(info().version).equal('57'); | ||
should(info().fullVersion).equal('57.0'); | ||
done(); | ||
}); | ||
it('should detect Waterfox', function(done) { | ||
global.navigator = { | ||
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x86; rv:40.0) Gecko/20100101 Firefox/40.0.2 Waterfox/40.0.2' | ||
}; | ||
should(info().name).equal('Waterfox'); | ||
should(info().os).equal('Windows'); | ||
should(info().version).equal('40'); | ||
should(info().fullVersion).equal('40.0.2'); | ||
done(); | ||
}); | ||
it('should detect OperaCoast', function(done) { | ||
@@ -80,0 +104,0 @@ global.navigator = { |
9737
214
7