browser-info
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -11,3 +11,3 @@ /* globals navigator*/ | ||
var match = ua.match(/(opera|chrome|safari|firefox|msie|edge|trident(?=\/))\/?\s*(\d+)/i) || []; | ||
var match = ua.match(/(opera|chrome|safari|firefox|edge|trident(?=\/))\/?\s*(\d+)/i) || []; | ||
@@ -32,2 +32,5 @@ if (ua.indexOf('Win') !== -1) { | ||
} | ||
if (ua.indexOf('Windows Phone') !== -1) { | ||
os = 'Windows Phone'; | ||
} | ||
@@ -34,0 +37,0 @@ if (/trident/i.test(match[1])) { |
{ | ||
"name": "browser-info", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Get browser info", | ||
@@ -5,0 +5,0 @@ "author": "Steve Lacy <me@slacy.me> (http://slacy.me)", |
@@ -49,5 +49,15 @@ 'use strict'; | ||
should(info().name).equal('IEMobile'); | ||
should(info().os).equal('Windows Phone'); | ||
should(info().name).equal('IE'); | ||
done(); | ||
}); | ||
it('should detect IE', function(done) { | ||
GLOBAL.navigator = { | ||
userAgent: 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko' | ||
}; | ||
should(info().name).equal('IE'); | ||
done(); | ||
}); | ||
}); |
6134
123