Merge pull request #345 from 8thwall/pixel3

Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models
This commit is contained in:
Faisal Salman 2018-10-25 22:56:46 +07:00 committed by GitHub
commit b88c52131f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 6 deletions

21
license.md Normal file
View 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.

View File

@ -20,6 +20,7 @@
"Aamir Poonawalla <aamir@urx.com>", "Aamir Poonawalla <aamir@urx.com>",
"Admas <mollases@users.noreply.github.com>", "Admas <mollases@users.noreply.github.com>",
"algenon <m@antonz.ru>", "algenon <m@antonz.ru>",
"Alvin Portillo <portilloalvin@gmail.com>",
"Andrea Vaghi <andrea.vaghi@jobrapido.com>", "Andrea Vaghi <andrea.vaghi@jobrapido.com>",
"Anton Zhiyanov <m@antonz.ru>", "Anton Zhiyanov <m@antonz.ru>",
"Arturo Mejia <amejia@blim.com>", "Arturo Mejia <amejia@blim.com>",

View File

@ -25,7 +25,7 @@
* `getBrowser()` * `getBrowser()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
``` ```sh
# Possible 'browser.name': # Possible 'browser.name':
2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu, 2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu,
Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless, Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless,
@ -47,7 +47,7 @@ Vivaldi, Waterfox, WeChat, Yandex, baidu, iCab, w3m
* `getDevice()` * `getDevice()`
* returns `{ model: '', type: '', vendor: '' }` * returns `{ model: '', type: '', vendor: '' }`
``` ```sh
# Possible 'device.type': # Possible 'device.type':
console, mobile, tablet, smarttv, wearable, embedded console, mobile, tablet, smarttv, wearable, embedded
@ -63,7 +63,7 @@ Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE
* `getEngine()` * `getEngine()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
``` ```sh
# Possible 'engine.name' # Possible 'engine.name'
Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto,
Tasman, Trident, w3m, WebKit Tasman, Trident, w3m, WebKit
@ -74,7 +74,7 @@ Tasman, Trident, w3m, WebKit
* `getOS()` * `getOS()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
``` ```sh
# Possible 'os.name' # Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki, AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS, Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
@ -89,7 +89,7 @@ Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk
* `getCPU()` * `getCPU()`
* returns `{ architecture: '' }` * returns `{ architecture: '' }`
``` ```sh
# Possible 'cpu.architecture' # Possible 'cpu.architecture'
68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] 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 $ 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 ## Using CLI
```sh ```sh

View File

@ -677,7 +677,7 @@
/android.+;\s(pixel c)\s/i // Google Pixel C /android.+;\s(pixel c)\s/i // Google Pixel C
], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [ ], [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]], [ ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [
/android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models

View File

@ -584,6 +584,33 @@
"type": "mobile" "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", "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", "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",