mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Merge branch 'faisalman:master' into smarttv
This commit is contained in:
commit
2033eb4aba
@ -36,7 +36,7 @@ Like so:
|
||||
```js
|
||||
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
|
||||
console.log(parser); // {}
|
||||
let parserResults = parser.getResults();
|
||||
let parserResults = parser.getResult();
|
||||
console.log(parserResults);
|
||||
/** {
|
||||
"ua": "",
|
||||
@ -48,7 +48,7 @@ console.log(parserResults);
|
||||
} */
|
||||
```
|
||||
|
||||
When you call UAParser without the `new` keyword, it will automatically call `getResults()` function and return the parsed results.
|
||||
When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
|
||||
* `UAParser([uastring][,extensions])`
|
||||
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||
|
||||
|
@ -336,7 +336,10 @@
|
||||
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
||||
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
|
||||
/(links) \(([\w\.]+)/i // Links
|
||||
], [NAME, VERSION]
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/(cobalt)\/([\w\.]+)/i // Cobalt
|
||||
], [NAME, [VERSION, /master.|lts./, ""]]
|
||||
],
|
||||
|
||||
cpu : [[
|
||||
@ -424,6 +427,8 @@
|
||||
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
||||
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
||||
], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [
|
||||
/(macintosh);/i
|
||||
], [MODEL, [VENDOR, APPLE]], [
|
||||
|
||||
// Huawei
|
||||
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
||||
|
@ -1601,5 +1601,41 @@
|
||||
"version" : "15.6,2",
|
||||
"major" : "15"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Cobalt 23 Master",
|
||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.master.0.0-devel (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
|
||||
"expect" : {
|
||||
"name" : "Cobalt",
|
||||
"version": "23.0.0",
|
||||
"major" : "23"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Cobalt 23 LTS",
|
||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.lts.1.0-qa (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
|
||||
"expect" : {
|
||||
"name" : "Cobalt",
|
||||
"version": "23.1.0",
|
||||
"major" : "23"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Cobalt 11",
|
||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/11.0-qa (unlike Gecko) Starboard/6",
|
||||
"expect" : {
|
||||
"name" : "Cobalt",
|
||||
"version": "11.0",
|
||||
"major" : "11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Cobalt 9",
|
||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/9.0-qa (unlike Gecko) Starboard/4",
|
||||
"expect" : {
|
||||
"name" : "Cobalt",
|
||||
"version": "9.0",
|
||||
"major" : "9"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -754,6 +754,15 @@
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Apple Desktop",
|
||||
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15",
|
||||
"expect": {
|
||||
"vendor": "Apple",
|
||||
"model": "Macintosh",
|
||||
"type": "undefined"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "iPad using UCBrowser",
|
||||
"ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3",
|
||||
|
Loading…
x
Reference in New Issue
Block a user