diff --git a/index.html b/index.html
index 9f217f2..2ba7b53 100644
--- a/index.html
+++ b/index.html
@@ -99,7 +99,6 @@
UA-Parser.js
JavaScript-based User-Agent Parser
- A small, quick & dirty script, which aims to extract a long piece of information about the details of the system contained in a user-agent string, into some small yet valuable pieces of commonly needed information such as the name of the browser & operating system along with the version
@@ -113,15 +112,18 @@
Browser |
Engine |
OS |
+ Device |
|
|
|
+ |
|
|
|
+ |
@@ -136,7 +138,7 @@
@@ -150,17 +152,20 @@
sel.appendChild(opt);
}
var fillTable = function(uastring){
- var parser = new uaparser(uastring);
+ var parser = UAParser.setUA(uastring);
var browser = parser.getBrowser();
var engine = parser.getEngine();
var os = parser.getOS();
+ var device = parser.getDevice();
var tbl = document.getElementsByTagName('td');
tbl[0].innerText = browser.name;
tbl[1].innerText = engine.name;
tbl[2].innerText = os.name;
- tbl[3].innerText = browser.version;
- tbl[4].innerText = engine.version;
- tbl[5].innerText = os.version;
+ tbl[3].innerText = device.name;
+ tbl[4].innerText = browser.version;
+ tbl[5].innerText = engine.version;
+ tbl[6].innerText = os.version;
+ tbl[7].innerText = device.version;
pre.innerHTML = 'Result for ' + (uastring ? uastring.replace(/';
}
fillTable();
diff --git a/ua-list-example.js b/ua-list-example.js
index eb926d5..007f1cd 100644
--- a/ua-list-example.js
+++ b/ua-list-example.js
@@ -1,6 +1,19 @@
// Only used for testing purpose
var uaExampleList = [
+"Mozilla/5.0 (Linux; U; Android 3.0.1; de-de; Transformer TF101 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
+"Nokia5238/40.9.003 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba",
+"Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; ZTE Jewe Build/1D7C2) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+"Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.0.2 Mobile/9A5259f Safari/6533.18.5",
+"Mozilla/5.0 (Linux; U; Android 3.1; en-us; Xoom Build/HMJ37) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
+"Mozilla/5.0 (BlackBerry; U; BlackBerry 9860; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/6.1.0.76 Mobile Safari/534.11+",
+"Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Dell Streak 7 Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+"Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.48 Safari/534.6 TouchPad/1.0",
+"Mozilla/5.0 (Linux; U; Android 2.2; ja-jp; E140 Build/Froyo) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1ACER_E140/1.0",
+"Mozilla/4.0 (compatible: MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; SAMSUNG; SGH-i917)",
+"Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; Nexus S 4G Build/GRJ90) AppleWebKit/533.1+ (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+"Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 800)",
+"Mozilla/5.0 (webOS/1.0; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0",
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en; rv:1.9.0.19) Gecko/2010111021 Camino/2.0.6 (MultiLang) (like Firefox/3.0.19)",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.21 Chrome/16.0.912.21 Safari/535.7",
@@ -40,4 +53,4 @@ var uaExampleList = [
"Mozilla/4.5 (compatible; iCab 2.9.1; Macintosh; U; PPC)",
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10pre) Gecko/2009041814 Firefox/3.0.10pre (Swiftfox)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Avant Browser; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)"
-];
\ No newline at end of file
+];