Check if userAgent property is defined

This commit is contained in:
Faisal Salman 2012-10-23 17:35:24 +07:00
parent 7ea79afc2f
commit 0288766544
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{ {
"title": "UA-Parser.JS", "title": "UA-Parser.JS",
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.4.4", "version": "0.4.5",
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)", "author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
"description": "Lightweight JavaScript-based user-agent string parser", "description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [ "keywords": [

View File

@ -1,4 +1,4 @@
// UA-Parser.JS v0.4.4 // UA-Parser.JS v0.4.5
// Lightweight JavaScript-based User-Agent string parser // Lightweight JavaScript-based User-Agent string parser
// https://github.com/faisalman/ua-parser-js // https://github.com/faisalman/ua-parser-js
// //
@ -264,7 +264,7 @@
var UAParser = function UAParser (uastring) { var UAParser = function UAParser (uastring) {
var ua = uastring || (typeof window !== 'undefined' ? window.navigator.userAgent : ""); var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : "");
this.getBrowser = function () { this.getBrowser = function () {
return mapper.regex.apply(this, regexes.browser); return mapper.regex.apply(this, regexes.browser);