Change calculation of `userAgent`.
Default to 'node-js' only if no user agent can be found the normal way.pull/344/head
parent
548c527aaf
commit
50d304022d
|
@ -80,14 +80,8 @@ function isArray(testObject)
|
|||
return testObject && typeof testObject === 'object' && !(testObject.propertyIsEnumerable('length')) && typeof testObject.length === 'number';
|
||||
}
|
||||
|
||||
if (typeof exports !== "undefined")
|
||||
{
|
||||
userAgent = "node-js";
|
||||
}
|
||||
else
|
||||
{
|
||||
userAgent = navigator.userAgent.toLowerCase();
|
||||
}
|
||||
var userAgent = (((function () {return this;})().navigator || {}).userAgent || 'node-js').toLowerCase();
|
||||
|
||||
// Figure out what browser is being used (stolen from jquery 1.2.1)
|
||||
var browser = {
|
||||
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
|
||||
|
|
Loading…
Reference in New Issue