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';
|
return testObject && typeof testObject === 'object' && !(testObject.propertyIsEnumerable('length')) && typeof testObject.length === 'number';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof exports !== "undefined")
|
var userAgent = (((function () {return this;})().navigator || {}).userAgent || 'node-js').toLowerCase();
|
||||||
{
|
|
||||||
userAgent = "node-js";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userAgent = navigator.userAgent.toLowerCase();
|
|
||||||
}
|
|
||||||
// Figure out what browser is being used (stolen from jquery 1.2.1)
|
// Figure out what browser is being used (stolen from jquery 1.2.1)
|
||||||
var browser = {
|
var browser = {
|
||||||
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
|
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
|
||||||
|
|
Loading…
Reference in New Issue