mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-15 22:52:16 +03:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80d6d137ba | ||
|
|
19b5ddd038 | ||
|
|
9133d73d50 | ||
|
|
3699c70a3a | ||
|
|
e6d276032b | ||
|
|
b68caafd94 | ||
|
|
eed632e3dd | ||
|
|
c5ce73f7de | ||
|
|
2c9c721a5c | ||
|
|
ec50c619ea | ||
|
|
07a7956eda | ||
|
|
be0eec6716 | ||
|
|
8d439d26b8 | ||
|
|
dc20c12b63 | ||
|
|
ecf8f7a849 | ||
|
|
3bf60cc830 | ||
|
|
8c94018351 | ||
|
|
9098ad501f | ||
|
|
376541a383 | ||
|
|
9cad6a0f2d |
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.5.26",
|
||||
"version": "0.6.2",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device"],
|
||||
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device", "cpu"],
|
||||
"scripts": ["src/ua-parser.js"],
|
||||
"main": "src/ua-parser.js",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.5.26",
|
||||
"version": "0.6.2",
|
||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
@@ -10,7 +10,8 @@
|
||||
"browser",
|
||||
"engine",
|
||||
"os",
|
||||
"device"
|
||||
"device",
|
||||
"cpu"
|
||||
],
|
||||
"homepage": "http://github.com/faisalman/ua-parser-js",
|
||||
"contributors": [
|
||||
|
||||
49
readme.md
49
readme.md
@@ -10,7 +10,7 @@ Lightweight JavaScript-based User-Agent string parser. Supports browser & node.j
|
||||
|
||||
## Features
|
||||
|
||||
Extract detailed type of web browser, layout engine, operating system, and device purely from user-agent string with relatively lightweight footprint (~7KB minified / ~3KB gzipped). Written in vanilla js, which means it doesn't depends on any other library.
|
||||
Extract detailed type of web browser, layout engine, operating system, cpu architecture, and device purely from user-agent string with relatively lightweight footprint (~7KB minified / ~3KB gzipped). Written in vanilla js, which means it doesn't depends on any other library.
|
||||
|
||||

|
||||
|
||||
@@ -23,11 +23,12 @@ Extract detailed type of web browser, layout engine, operating system, and devic
|
||||
# Possible 'browser.name':
|
||||
Amaya, Arora, Avant, Baidu, Blazer, Bolt, Camino, Chimera, Chrome, Chromium,
|
||||
Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Epiphany, Fennec, Firebird,
|
||||
Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, Iceweasel,
|
||||
IE [Mobile], Jasmine, K-Meleon, Konqueror, Kindle, Links, Lunascape, Lynx, Maemo,
|
||||
Maxthon, Midori, Minimo, [Mobile] Safari, Mosaic, Mozilla, Netfront, Netscape,
|
||||
NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], Phoenix, Polaris, RockMelt,
|
||||
Silk, Skyfire, SeaMonkey, SlimBrowser, Swiftfox, Tizen, UCBrowser, w3m, Yandex
|
||||
Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDragon,
|
||||
Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links,
|
||||
Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, [Mobile] Safari, Mosaic, Mozilla,
|
||||
Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], Phoenix,
|
||||
Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser, Swiftfox,
|
||||
Tizen, UCBrowser, w3m, Yandex
|
||||
|
||||
# 'browser.version' & 'browser.major' determined dynamically
|
||||
```
|
||||
@@ -73,8 +74,16 @@ Windows [Phone/Mobile], Zenwalk
|
||||
# 'os.version' determined dynamically
|
||||
```
|
||||
|
||||
* `getCPU()`
|
||||
* returns `{ architecture: '' }`
|
||||
|
||||
```
|
||||
# Possible 'cpu.architecture'
|
||||
68k, amd64, arm, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64
|
||||
```
|
||||
|
||||
* `getResult()`
|
||||
* returns `{ browser: {}, device: {}, engine: {}, os: {} }`
|
||||
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||
* `getUA()`
|
||||
* returns UA string of current instance
|
||||
* `setUA(uastring)`
|
||||
@@ -96,6 +105,7 @@ Windows [Phone/Mobile], Zenwalk
|
||||
/*
|
||||
/// this will print an object structured like this:
|
||||
{
|
||||
ua: "",
|
||||
browser: {
|
||||
name: "",
|
||||
version: "",
|
||||
@@ -113,6 +123,9 @@ Windows [Phone/Mobile], Zenwalk
|
||||
model: "",
|
||||
type: "",
|
||||
vendor: ""
|
||||
},
|
||||
cpu: {
|
||||
architecture: ""
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -130,6 +143,7 @@ Windows [Phone/Mobile], Zenwalk
|
||||
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
|
||||
console.log(result.os.version); // "11.10"
|
||||
console.log(result.engine.name); // "WebKit"
|
||||
console.log(result.cpu.architecture); // "amd64"
|
||||
|
||||
// do some other tests
|
||||
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)";
|
||||
@@ -149,15 +163,6 @@ Windows [Phone/Mobile], Zenwalk
|
||||
</html>
|
||||
```
|
||||
|
||||
### Using requirejs
|
||||
|
||||
```js
|
||||
require(['ua-parser'], function(UAParser) {
|
||||
var parser = new UAParser();
|
||||
console.log(parser.getResult());
|
||||
});
|
||||
```
|
||||
|
||||
### Using node.js
|
||||
|
||||
```sh
|
||||
@@ -166,8 +171,18 @@ $ npm install ua-parser-js
|
||||
|
||||
```js
|
||||
var UAParser = require('ua-parser-js');
|
||||
var parser = new UAParser();
|
||||
var ua = request.headers['user-agent']; // user-agent header from an HTTP request
|
||||
console.log(parser.setUA(ua).getResult());
|
||||
```
|
||||
|
||||
### Using requirejs
|
||||
|
||||
```js
|
||||
require(['ua-parser'], function(UAParser) {
|
||||
var parser = new UAParser();
|
||||
console.log(parser.getResult());
|
||||
});
|
||||
```
|
||||
|
||||
### Using component
|
||||
@@ -190,7 +205,7 @@ $ bower install ua-parser-js
|
||||
|
||||
### Using jQuery.ua
|
||||
|
||||
Although written in vanilla js (which means it doesn't depends on jQuery), if you're using jQuery, this library will automatically detect and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
|
||||
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
|
||||
|
||||
```js
|
||||
// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// UAParser.js v0.5.26
|
||||
// UAParser.js v0.6.2
|
||||
// Lightweight JavaScript-based User-Agent string parser
|
||||
// https://github.com/faisalman/ua-parser-js
|
||||
//
|
||||
@@ -25,6 +25,7 @@
|
||||
TYPE = 'type',
|
||||
VENDOR = 'vendor',
|
||||
VERSION = 'version',
|
||||
ARCHITECTURE= 'architecture',
|
||||
CONSOLE = 'console',
|
||||
MOBILE = 'mobile',
|
||||
TABLET = 'tablet';
|
||||
@@ -38,6 +39,9 @@
|
||||
var util = {
|
||||
has : function (str1, str2) {
|
||||
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
|
||||
},
|
||||
lowerize : function (str) {
|
||||
return str.toLowerCase();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -80,8 +84,13 @@
|
||||
// check if given property is actually array
|
||||
if (typeof(q) === OBJ_TYPE && q.length > 0) {
|
||||
if (q.length == 2) {
|
||||
if (typeof(q[1]) == FUNC_TYPE) {
|
||||
// assign modified match
|
||||
result[q[0]] = q[1].call(this, match);
|
||||
} else {
|
||||
// assign given value, ignore regex match
|
||||
result[q[0]] = q[1];
|
||||
}
|
||||
} else if (q.length == 3) {
|
||||
// check whether function or regex
|
||||
if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) {
|
||||
@@ -91,6 +100,8 @@
|
||||
// sanitize match using given regex
|
||||
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
|
||||
}
|
||||
} else if (q.length == 4) {
|
||||
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
|
||||
}
|
||||
} else {
|
||||
result[q] = match ? match : undefined;
|
||||
@@ -110,7 +121,7 @@
|
||||
for (var i in map) {
|
||||
// check if array
|
||||
if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) {
|
||||
for (var j in map[i]) {
|
||||
for (var j = 0; j < map[i].length; j++) {
|
||||
if (util.has(map[i][j], str)) {
|
||||
return (i === UNKNOWN) ? undefined : i;
|
||||
}
|
||||
@@ -209,14 +220,17 @@
|
||||
// Trident based
|
||||
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
|
||||
// Avant/IEMobile/SlimBrowser/Baidu
|
||||
/ms(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
|
||||
/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
|
||||
|
||||
// Webkit/KHTML based
|
||||
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
|
||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt)\/((\d+)?[\w\.-]+)/i
|
||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt
|
||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
|
||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron
|
||||
], [NAME, VERSION, MAJOR], [
|
||||
|
||||
/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11
|
||||
], [[NAME, 'IE'], VERSION, MAJOR], [
|
||||
|
||||
/(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex
|
||||
], [[NAME, 'Yandex'], VERSION, MAJOR], [
|
||||
|
||||
@@ -250,15 +264,15 @@
|
||||
/(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape
|
||||
], [[NAME, 'Netscape'], VERSION, MAJOR], [
|
||||
/(swiftfox)/i, // Swiftfox
|
||||
/(iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
|
||||
// Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
||||
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
|
||||
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
||||
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
|
||||
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
||||
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
|
||||
|
||||
// Other
|
||||
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i,
|
||||
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf
|
||||
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
|
||||
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser
|
||||
/(links)\s\(((\d+)?[\w\.]+)/i, // Links
|
||||
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser
|
||||
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser
|
||||
@@ -266,6 +280,29 @@
|
||||
], [NAME, VERSION, MAJOR]
|
||||
],
|
||||
|
||||
cpu : [[
|
||||
|
||||
/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64
|
||||
], [[ARCHITECTURE, 'amd64']], [
|
||||
|
||||
/((?:i[346]|x)86)[;\)]/i // IA32
|
||||
], [[ARCHITECTURE, 'ia32']], [
|
||||
|
||||
// PocketPC mistakenly identified as PowerPC
|
||||
/windows\s(ce|mobile);\sppc;/i
|
||||
], [[ARCHITECTURE, 'arm']], [
|
||||
|
||||
/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC
|
||||
], [[ARCHITECTURE, /ower/, '', util.lowerize]], [
|
||||
|
||||
/(sun4\w)[;\)]/i // SPARC
|
||||
], [[ARCHITECTURE, 'sparc']], [
|
||||
|
||||
/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
||||
// IA64, 68K, ARM, IRIX, MIPS, SPARC, PA-RISC
|
||||
], [ARCHITECTURE, util.lowerize]
|
||||
],
|
||||
|
||||
device : [[
|
||||
|
||||
/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook
|
||||
@@ -310,7 +347,8 @@
|
||||
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
||||
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
||||
|
||||
/\s((milestone|droid[2x]?))[globa\s]*\sbuild\//i, // Motorola
|
||||
// Motorola
|
||||
/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
|
||||
/(mot)[\s-]?(\w+)*/i
|
||||
], [[VENDOR, 'Motorola'], MODEL, [TYPE, MOBILE]], [
|
||||
/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i
|
||||
@@ -431,6 +469,9 @@
|
||||
this.getBrowser = function () {
|
||||
return mapper.rgx.apply(this, regexes.browser);
|
||||
};
|
||||
this.getCPU = function () {
|
||||
return mapper.rgx.apply(this, regexes.cpu);
|
||||
};
|
||||
this.getDevice = function () {
|
||||
return mapper.rgx.apply(this, regexes.device);
|
||||
};
|
||||
@@ -442,10 +483,12 @@
|
||||
};
|
||||
this.getResult = function() {
|
||||
return {
|
||||
ua : this.getUA(),
|
||||
browser : this.getBrowser(),
|
||||
engine : this.getEngine(),
|
||||
os : this.getOS(),
|
||||
device : this.getDevice()
|
||||
device : this.getDevice(),
|
||||
cpu : this.getCPU()
|
||||
};
|
||||
};
|
||||
this.getUA = function () {
|
||||
|
||||
8
src/ua-parser.min.js
vendored
8
src/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -239,6 +239,26 @@
|
||||
"major" : "7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "IE 11 with IE token",
|
||||
"ua" : "Mozilla/5.0 (IE 11.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "IE",
|
||||
"version" : "11.0",
|
||||
"major" : "11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "IE 11 without IE token",
|
||||
"ua" : "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "IE",
|
||||
"version" : "11.0",
|
||||
"major" : "11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "K-Meleon",
|
||||
"ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2",
|
||||
|
||||
89
test/cpu-test.json
Normal file
89
test/cpu-test.json
Normal file
@@ -0,0 +1,89 @@
|
||||
[
|
||||
{
|
||||
"desc" : "i686",
|
||||
"ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "ia32"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "i386",
|
||||
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "ia32"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "x86-64",
|
||||
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "amd64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "win64",
|
||||
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "amd64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "WOW64",
|
||||
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "amd64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "ARMv6",
|
||||
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Pocket PC",
|
||||
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Mac PowerPC",
|
||||
"ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "ppc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Mac PowerPC",
|
||||
"ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "ppc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Mac PowerPC",
|
||||
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "ppc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "UltraSPARC",
|
||||
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
|
||||
"expect" :
|
||||
{
|
||||
"architecture" : "sparc"
|
||||
}
|
||||
}]
|
||||
@@ -18,4 +18,14 @@
|
||||
"model" : "Nexus 4",
|
||||
"type" : "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Motorola Droid RAZR 4G",
|
||||
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
|
||||
"expect" :
|
||||
{
|
||||
"vendor" : "Motorola",
|
||||
"model" : "DROID RAZR 4G",
|
||||
"type" : "mobile"
|
||||
}
|
||||
}]
|
||||
@@ -1,6 +1,7 @@
|
||||
var assert = require('assert');
|
||||
var UAParser = require('./../src/ua-parser');
|
||||
var browsers = require('./browser-test.json');
|
||||
var cpus = require('./cpu-test.json');
|
||||
var devices = require('./device-test.json');
|
||||
var engines = require('./engine-test.json');
|
||||
var os = require('./os-test.json');
|
||||
@@ -12,6 +13,12 @@ var methods = [
|
||||
list : browsers,
|
||||
properties : ['name', 'major', 'version']
|
||||
},
|
||||
{
|
||||
title : 'getCPU',
|
||||
label : 'cpu',
|
||||
list : cpus,
|
||||
properties : ['architecture']
|
||||
},
|
||||
{
|
||||
title : 'getDevice',
|
||||
label : 'device',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.5.26",
|
||||
"version": "0.6.2",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
"user-agent",
|
||||
@@ -9,7 +9,8 @@
|
||||
"browser",
|
||||
"engine",
|
||||
"os",
|
||||
"device"
|
||||
"device",
|
||||
"cpu"
|
||||
],
|
||||
"homepage": "https://faisalman.github.com/ua-parser-js",
|
||||
"author": {
|
||||
|
||||
Reference in New Issue
Block a user