mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Check if userAgent property is defined
This commit is contained in:
parent
7ea79afc2f
commit
0288766544
@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UA-Parser.JS",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
|
@ -1,4 +1,4 @@
|
||||
// UA-Parser.JS v0.4.4
|
||||
// UA-Parser.JS v0.4.5
|
||||
// Lightweight JavaScript-based User-Agent string parser
|
||||
// https://github.com/faisalman/ua-parser-js
|
||||
//
|
||||
@ -264,10 +264,10 @@
|
||||
|
||||
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 () {
|
||||
return mapper.regex.apply(this, regexes.browser);
|
||||
return mapper.regex.apply(this, regexes.browser);
|
||||
};
|
||||
|
||||
this.getDevice = function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user