3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
897 stars 137 forks source link

useragent failed to check IE7 #64

Closed enginespot closed 9 years ago

enginespot commented 9 years ago
var useragent= require("useragent");

var agent = useragent.parse("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");

var ua= useragent.is("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");

result: { family: 'IE', major: '7', minor: '0', patch: '0', source: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)' }

{ chrome: false, firefox: false, ie: false, mobile_safari: false, mozilla: false, opera: false, safari: false, webkit: false, android: false, version: '7.0' }

3rd-Eden commented 9 years ago

As the https://github.com/3rd-Eden/useragent#useragentisuseragent-stringbrowsername states, you shouldn't expect any good parsing from this as this is a quick and dirty regexp that jquery and other used to parse user agents.