From f1065dc4f8d367707dcc6e4327236fd1d2f72c33 Mon Sep 17 00:00:00 2001 From: Faisalman Date: Thu, 19 Jul 2012 05:52:11 +0700 Subject: [PATCH 1/3] Added some devices: Asus, Acer, Dell, Nexus, ZTE --- ua-parser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ua-parser.js b/ua-parser.js index 142e85b..96aeede 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -177,7 +177,8 @@ function UAParser (uastring) { /\((ip[honead]+|playbook);/i, // iPod/iPhone/iPad/PlayBook /(blackberry)[\s-]?(\w+)/i, // BlackBerry - /(blackberry|benq|nokia|palm(?=\-)|sonyericsson)[\s-]?([\w-]+)*/i, // BenQ/Nokia/Palm/Sony-Ericsson + /(blackberry|benq|nokia|palm(?=\-)|sonyericsson|acer|asus|dell|nexus|zte)[\s_-]?([\w-]+)*/i, + // BenQ/Nokia/Palm/Sony-Ericsson/Acer/Asus/Dell/Nexus/ZTE /(hp)\s([\w\s]+)/i, // HP iPAQ /(hp).+(touchpad)/i, // HP TouchPad /(kindle)\/([\w\.]+)/i, // Kindle @@ -197,6 +198,9 @@ function UAParser (uastring) { /sam[sung]*[\s-]*(\w+-?[\w-]*)*/i, /sec-(sgh\w+)/i ], [['name', 'Samsung'], 'version'], [ + + /(transfo[prime\s]{4,10}\s\w+|(?:android).*eeepc)/i // Asus + ], [['name', 'Asus'], 'version'], [ /sie-(\w+)*/i // Siemens ], [['name', 'Siemens'], 'version']); From 5e4d686e3eabe8fc6b3ef644f8560498316d9883 Mon Sep 17 00:00:00 2001 From: Faisalman Date: Thu, 19 Jul 2012 22:45:55 +0700 Subject: [PATCH 2/3] Tag v0.2.1 --- package.json | 2 +- readme.md | 11 ++++++++--- ua-parser.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 96e0cdc..1475e71 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title" : "UA-Parser.js", "name" : "ua-parser-js", - "version" : "0.1.2", + "version" : "0.2.1", "author" : { "name" : "Faisal Salman", "email" : "fyzlman@gmail.com", diff --git a/readme.md b/readme.md index 57fa7a6..5df835f 100644 --- a/readme.md +++ b/readme.md @@ -2,10 +2,10 @@ JavaScript-based user-agent parser -* Author : Faisalman <> +* Author : Faisalman <> * Home : http://faisalman.github.com/ua-parser-js -* Source : https://github.com/faisalman/ua-parser-js -* License : GPLv2 +* Source : https://github.com/faisalman/ua-parser-js +* License : GPLv2 ## Features @@ -14,6 +14,7 @@ Get detailed type and version of web browser, layout engine, and operating syste ## Methods * `getBrowser([uastring])` +* `getDevice([uastring])` * `getEngine([uastring])` * `getOS([uastring])` * `setUA(uastring)` @@ -35,6 +36,10 @@ Get detailed type and version of web browser, layout engine, and operating syste version: "", major: "" }, + device: { + name: "", + version: "" + }, engine: { name: "", version: "" diff --git a/ua-parser.js b/ua-parser.js index 96aeede..1963f5e 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -1,4 +1,4 @@ -// UA-Parser.js v0.2.0 +// UA-Parser.js v0.2.1 // Lightweight JavaScript-based user-agent parser // https://github.com/faisalman/ua-parser-js // From faefb6fbb7ad6b250d8cb841885a3497009fd957 Mon Sep 17 00:00:00 2001 From: Faisalman Date: Thu, 19 Jul 2012 23:14:41 +0700 Subject: [PATCH 3/3] Added new browser: Chrome for iOS --- ua-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ua-parser.js b/ua-parser.js index 1963f5e..1a59825 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -98,7 +98,7 @@ function UAParser (uastring) { /(chromium|flock|rockmelt|midori|epiphany)\/((\d+)?[\w\.]+)/i, // Chromium/Flock/RockMelt/Midori/Epiphany /(chrome|omniweb|arora|dolfin)\/((\d+)?[\w\.]+)/i, // Chrome/OmniWeb/Arora/Dolphin ], ['name', 'version', 'major'], [ - /android.+crmo\/((\d+)?[\w\.]+)/i, // Chrome for Android + /(?:android.+crmo|crios)\/((\d+)?[\w\.]+)/i, // Chrome for Android/iOS ], [['name', 'Chrome'], 'version', 'major'], [ /(mobile\ssafari|safari|konqueror)\/((\d+)?[\w\.]+)/i, // Safari/Konqueror /(applewebkit|khtml)\/((\d+)?[\w\.]+)/i,