mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Include ua in result object
This commit is contained in:
parent
8d439d26b8
commit
be0eec6716
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"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.6.0",
|
||||
"version": "0.6.1",
|
||||
"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": [
|
||||
|
@ -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.
|
||||
|
||||

|
||||
|
||||
@ -78,11 +78,11 @@ Windows [Phone/Mobile], Zenwalk
|
||||
|
||||
```
|
||||
# Possible 'cpu.architecture'
|
||||
68k, amd64, arm, ia32, ia64, irix, mips, pa-risc, ppc, sparc
|
||||
68k, amd64, arm, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64
|
||||
```
|
||||
|
||||
* `getResult()`
|
||||
* returns `{ browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||
* `getUA()`
|
||||
* returns UA string of current instance
|
||||
* `setUA(uastring)`
|
||||
@ -104,6 +104,7 @@ Windows [Phone/Mobile], Zenwalk
|
||||
/*
|
||||
/// this will print an object structured like this:
|
||||
{
|
||||
ua: "",
|
||||
browser: {
|
||||
name: "",
|
||||
version: "",
|
||||
|
@ -1,4 +1,4 @@
|
||||
// UAParser.js v0.6.0
|
||||
// UAParser.js v0.6.1
|
||||
// Lightweight JavaScript-based User-Agent string parser
|
||||
// https://github.com/faisalman/ua-parser-js
|
||||
//
|
||||
@ -479,6 +479,7 @@
|
||||
};
|
||||
this.getResult = function() {
|
||||
return {
|
||||
ua : this.getUA(),
|
||||
browser : this.getBrowser(),
|
||||
engine : this.getEngine(),
|
||||
os : this.getOS(),
|
||||
|
2
src/ua-parser.min.js
vendored
2
src/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"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": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user