mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-21 01:26:40 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e4d686e3e | ||
|
|
f1065dc4f8 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title" : "UA-Parser.js",
|
"title" : "UA-Parser.js",
|
||||||
"name" : "ua-parser-js",
|
"name" : "ua-parser-js",
|
||||||
"version" : "0.1.2",
|
"version" : "0.2.1",
|
||||||
"author" : {
|
"author" : {
|
||||||
"name" : "Faisal Salman",
|
"name" : "Faisal Salman",
|
||||||
"email" : "fyzlman@gmail.com",
|
"email" : "fyzlman@gmail.com",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Get detailed type and version of web browser, layout engine, and operating syste
|
|||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
* `getBrowser([uastring])`
|
* `getBrowser([uastring])`
|
||||||
|
* `getDevice([uastring])`
|
||||||
* `getEngine([uastring])`
|
* `getEngine([uastring])`
|
||||||
* `getOS([uastring])`
|
* `getOS([uastring])`
|
||||||
* `setUA(uastring)`
|
* `setUA(uastring)`
|
||||||
@@ -35,6 +36,10 @@ Get detailed type and version of web browser, layout engine, and operating syste
|
|||||||
version: "",
|
version: "",
|
||||||
major: ""
|
major: ""
|
||||||
},
|
},
|
||||||
|
device: {
|
||||||
|
name: "",
|
||||||
|
version: ""
|
||||||
|
},
|
||||||
engine: {
|
engine: {
|
||||||
name: "",
|
name: "",
|
||||||
version: ""
|
version: ""
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// UA-Parser.js v0.2.0
|
// UA-Parser.js v0.2.1
|
||||||
// Lightweight JavaScript-based user-agent parser
|
// Lightweight JavaScript-based user-agent parser
|
||||||
// https://github.com/faisalman/ua-parser-js
|
// https://github.com/faisalman/ua-parser-js
|
||||||
//
|
//
|
||||||
@@ -177,7 +177,8 @@ function UAParser (uastring) {
|
|||||||
|
|
||||||
/\((ip[honead]+|playbook);/i, // iPod/iPhone/iPad/PlayBook
|
/\((ip[honead]+|playbook);/i, // iPod/iPhone/iPad/PlayBook
|
||||||
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
|
/(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)\s([\w\s]+)/i, // HP iPAQ
|
||||||
/(hp).+(touchpad)/i, // HP TouchPad
|
/(hp).+(touchpad)/i, // HP TouchPad
|
||||||
/(kindle)\/([\w\.]+)/i, // Kindle
|
/(kindle)\/([\w\.]+)/i, // Kindle
|
||||||
@@ -198,6 +199,9 @@ function UAParser (uastring) {
|
|||||||
/sec-(sgh\w+)/i
|
/sec-(sgh\w+)/i
|
||||||
], [['name', 'Samsung'], 'version'], [
|
], [['name', 'Samsung'], 'version'], [
|
||||||
|
|
||||||
|
/(transfo[prime\s]{4,10}\s\w+|(?:android).*eeepc)/i // Asus
|
||||||
|
], [['name', 'Asus'], 'version'], [
|
||||||
|
|
||||||
/sie-(\w+)*/i // Siemens
|
/sie-(\w+)*/i // Siemens
|
||||||
], [['name', 'Siemens'], 'version']);
|
], [['name', 'Siemens'], 'version']);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user