From 145334a963def05378caa52fdb469eeffb02982d Mon Sep 17 00:00:00 2001 From: Faisalman Date: Mon, 5 Mar 2012 19:01:49 +0700 Subject: [PATCH] Accept custom ua string input while construct --- ua-parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ua-parser.js b/ua-parser.js index 14354b4..f073609 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -7,7 +7,7 @@ * Licensed under GPL2 http://www.gnu.org/licenses/gpl-2.0.html */ -function uaparser(){ +function uaparser(uastring){ // regexp mapper var regxMap = function(ua){ @@ -69,7 +69,7 @@ function uaparser(){ }; }; - this.ua = window.navigator.userAgent; + this.ua = uastring || window.navigator.userAgent; this.getBrowser = function(){