mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Merge pull request #345 from 8thwall/pixel3
Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models
This commit is contained in:
commit
b88c52131f
21
license.md
Normal file
21
license.md
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012-2018 Faisal Salman <<f@faisalman.com>>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -20,6 +20,7 @@
|
||||
"Aamir Poonawalla <aamir@urx.com>",
|
||||
"Admas <mollases@users.noreply.github.com>",
|
||||
"algenon <m@antonz.ru>",
|
||||
"Alvin Portillo <portilloalvin@gmail.com>",
|
||||
"Andrea Vaghi <andrea.vaghi@jobrapido.com>",
|
||||
"Anton Zhiyanov <m@antonz.ru>",
|
||||
"Arturo Mejia <amejia@blim.com>",
|
||||
|
18
readme.md
18
readme.md
@ -25,7 +25,7 @@
|
||||
* `getBrowser()`
|
||||
* returns `{ name: '', version: '' }`
|
||||
|
||||
```
|
||||
```sh
|
||||
# Possible 'browser.name':
|
||||
2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu,
|
||||
Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless,
|
||||
@ -47,7 +47,7 @@ Vivaldi, Waterfox, WeChat, Yandex, baidu, iCab, w3m
|
||||
* `getDevice()`
|
||||
* returns `{ model: '', type: '', vendor: '' }`
|
||||
|
||||
```
|
||||
```sh
|
||||
# Possible 'device.type':
|
||||
console, mobile, tablet, smarttv, wearable, embedded
|
||||
|
||||
@ -63,7 +63,7 @@ Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE
|
||||
* `getEngine()`
|
||||
* returns `{ name: '', version: '' }`
|
||||
|
||||
```
|
||||
```sh
|
||||
# Possible 'engine.name'
|
||||
Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto,
|
||||
Tasman, Trident, w3m, WebKit
|
||||
@ -74,7 +74,7 @@ Tasman, Trident, w3m, WebKit
|
||||
* `getOS()`
|
||||
* returns `{ name: '', version: '' }`
|
||||
|
||||
```
|
||||
```sh
|
||||
# Possible 'os.name'
|
||||
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
|
||||
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
|
||||
@ -89,7 +89,7 @@ Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk
|
||||
* `getCPU()`
|
||||
* returns `{ architecture: '' }`
|
||||
|
||||
```
|
||||
```sh
|
||||
# Possible 'cpu.architecture'
|
||||
68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
|
||||
```
|
||||
@ -233,6 +233,14 @@ $ bower install ua-parser-js
|
||||
$ meteor add faisalman:ua-parser-js
|
||||
```
|
||||
|
||||
## Using TypeScript
|
||||
|
||||
```sh
|
||||
$ npm install --save @types/ua-parser-js
|
||||
# Download TS type definition from DefinitelyTyped repository:
|
||||
# https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js
|
||||
```
|
||||
|
||||
## Using CLI
|
||||
|
||||
```sh
|
||||
|
@ -677,7 +677,7 @@
|
||||
/android.+;\s(pixel c)\s/i // Google Pixel C
|
||||
], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [
|
||||
|
||||
/android.+;\s(pixel [xl2]{1,2}|pixel)\s/i // Google Pixel
|
||||
/android.+;\s(pixel( [23])?( xl)?)\s/i // Google Pixel
|
||||
], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [
|
||||
|
||||
/android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
|
||||
|
@ -584,6 +584,33 @@
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Google Pixel 2 XL",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 8.1.0; Pixel 2 XL Build/OPM1.171019.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Safari/537.36",
|
||||
"expect": {
|
||||
"vendor": "Google",
|
||||
"model": "Pixel 2 XL",
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Google Pixel 3",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
|
||||
"expect": {
|
||||
"vendor": "Google",
|
||||
"model": "Pixel 3",
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Google Pixel 3 XL",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
|
||||
"expect": {
|
||||
"vendor": "Google",
|
||||
"model": "Pixel 3 XL",
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Generic Android Device",
|
||||
"ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; i980 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
||||
|
Loading…
x
Reference in New Issue
Block a user