mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Merge branch 'develop' into develop
This commit is contained in:
commit
3bad800860
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
### vim ###
|
### vim ###
|
||||||
.*.s[a-w][a-z]
|
.*.s[a-w][a-z]
|
||||||
*.un~
|
*.un~
|
||||||
@ -8,17 +9,20 @@ Session.vim
|
|||||||
*~
|
*~
|
||||||
.versions
|
.versions
|
||||||
|
|
||||||
|
### editors ###
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
*.sublime-*
|
||||||
|
|
||||||
### OSX ###
|
### OSX ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
.LSOverride
|
.LSOverride
|
||||||
Icon
|
Icon
|
||||||
|
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
._*
|
._*
|
||||||
|
|
||||||
# Files that might appear on external disk
|
# Files that might appear on external disk
|
||||||
.Spotlight-V100
|
.Spotlight-V100
|
||||||
.Trashes
|
.Trashes
|
||||||
.idea
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- stable
|
- stable
|
||||||
- "0.10"
|
- lts/*
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.12",
|
"version": "0.7.19",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Faisal Salman <fyzlman@gmail.com>"
|
"Faisal Salman <fyzlman@gmail.com>"
|
||||||
],
|
],
|
||||||
|
9
dist/ua-parser.min.js
vendored
9
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
9
dist/ua-parser.pack.js
vendored
9
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
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.
|
@ -1,6 +1,6 @@
|
|||||||
Package.describe({
|
Package.describe({
|
||||||
name: 'faisalman:ua-parser-js',
|
name: 'faisalman:ua-parser-js',
|
||||||
version: '0.7.12',
|
version: '0.7.19',
|
||||||
summary: 'Lightweight JavaScript-based user-agent string parser',
|
summary: 'Lightweight JavaScript-based user-agent string parser',
|
||||||
git: 'https://github.com/faisalman/ua-parser-js.git',
|
git: 'https://github.com/faisalman/ua-parser-js.git',
|
||||||
documentation: 'readme.md'
|
documentation: 'readme.md'
|
||||||
|
42
package.json
42
package.json
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.12",
|
"version": "0.7.19",
|
||||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"user-agent",
|
"user-agent",
|
||||||
@ -11,33 +11,45 @@
|
|||||||
"engine",
|
"engine",
|
||||||
"os",
|
"os",
|
||||||
"device",
|
"device",
|
||||||
"cpu"
|
"cpu",
|
||||||
|
"jquery-plugin",
|
||||||
|
"ecosystem:jquery"
|
||||||
],
|
],
|
||||||
"homepage": "http://github.com/faisalman/ua-parser-js",
|
"homepage": "http://github.com/faisalman/ua-parser-js",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"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>",
|
||||||
|
"Arun Rama Reddy <arunramareddy@gmail.com>",
|
||||||
"Austin Pray <austin@austinpray.com>",
|
"Austin Pray <austin@austinpray.com>",
|
||||||
"Benjamin Bertrand <bertrand.design@gmail.com>",
|
"Benjamin Bertrand <bertrand.design@gmail.com>",
|
||||||
|
"Benjamin Urban <benjamin.urban@sueddeutsche.de>",
|
||||||
"boneyao <admin@boneyao.com>",
|
"boneyao <admin@boneyao.com>",
|
||||||
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
|
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
|
||||||
"CESAR RAMOS <c@imagenproactiva.com>",
|
"CESAR RAMOS <c@imagenproactiva.com>",
|
||||||
"Christopher De Cairos <chris.decairos@gmail.com>",
|
"Christopher De Cairos <chris.decairos@gmail.com>",
|
||||||
|
"Dario Vladovic <d.vladimyr@gmail.com>",
|
||||||
"Davit Barbakadze <jayarjo@gmail.com>",
|
"Davit Barbakadze <jayarjo@gmail.com>",
|
||||||
"ddivernois <david-emmanuel.divernois@amadeus.com>",
|
"ddivernois <david-emmanuel.divernois@amadeus.com>",
|
||||||
"Demis Palma <demis.palma@gmail.com>",
|
"Demis Palma <demis.palma@gmail.com>",
|
||||||
|
"dhoko <aurelien@protonmail.com>",
|
||||||
|
"dianhe <dianhe@webank.com>",
|
||||||
"Dmitry Tyschenko <dtyschenko@gmail.com>",
|
"Dmitry Tyschenko <dtyschenko@gmail.com>",
|
||||||
"Douglas Li <doug@knotch.it>",
|
"Douglas Li <doug@knotch.it>",
|
||||||
"Dumitru Uzun <contact@duzun.me>",
|
"Dumitru Uzun <contact@duzun.me>",
|
||||||
|
"Eric Schrenker <eric.schrenker@gmail.com>",
|
||||||
"Erik Hesselink <hesselink@gmail.com>",
|
"Erik Hesselink <hesselink@gmail.com>",
|
||||||
"Fabian Becker <halfdan@xnorfz.de>",
|
"Fabian Becker <halfdan@xnorfz.de>",
|
||||||
"Faisal Salman <fyzlman@gmail.com>",
|
"Faisal Salman <fyzlman@gmail.com>",
|
||||||
"Frédéric Camblor <fcamblor@gmail.com>",
|
"Frédéric Camblor <fcamblor@gmail.com>",
|
||||||
|
"Germán M. Bravo <german.mb@gmail.com>",
|
||||||
"Grigory Dmitrenko <grigory@snsk.ru>",
|
"Grigory Dmitrenko <grigory@snsk.ru>",
|
||||||
"Hendrik Helwich <h.helwich@iplabs.de>",
|
"Hendrik Helwich <h.helwich@iplabs.de>",
|
||||||
|
"Hermann Ebert <ebbmo@HE.local>",
|
||||||
"jackpoll <jackpoll123456@gmail.com>",
|
"jackpoll <jackpoll123456@gmail.com>",
|
||||||
"Jake Mc <startswithaj@users.noreply.github.com>",
|
"Jake Mc <startswithaj@users.noreply.github.com>",
|
||||||
"John Tantalo <john.tantalo@gmail.com>",
|
"John Tantalo <john.tantalo@gmail.com>",
|
||||||
@ -46,30 +58,39 @@
|
|||||||
"Kendall Buchanan <kendall@kendagriff.com>",
|
"Kendall Buchanan <kendall@kendagriff.com>",
|
||||||
"Lee Treveil <leetreveil@gmail.com>",
|
"Lee Treveil <leetreveil@gmail.com>",
|
||||||
"leonardo <leofiore@libero.it>",
|
"leonardo <leofiore@libero.it>",
|
||||||
"Levente Balogh <noreply@github.com>",
|
"Levente Balogh <balogh.levente.hu@gmail.com>",
|
||||||
"Liam Quinn <lquinn@blackberry.com>",
|
"Liam Quinn <lquinn@blackberry.com>",
|
||||||
"Lithin <lithin@webklipper.com>",
|
"Lithin <lithin@webklipper.com>",
|
||||||
|
"Loris Guignard <loris.guignard@gmail.com>",
|
||||||
|
"Lukas Drgon <lukas.drgon@gmail.com>",
|
||||||
"Lukas Eipert <leipert@users.noreply.github.com>",
|
"Lukas Eipert <leipert@users.noreply.github.com>",
|
||||||
"Malash <i@malash.me>",
|
"Malash <i@malash.me>",
|
||||||
"Martynas <noreply@github.com>",
|
"Martynas <martynas@firmfirm.co>",
|
||||||
"Maximilian Haupt <mail@maximilianhaupt.com>",
|
"Matt Brophy <matt@brophy.org>",
|
||||||
"Max Maurer <maxemanuel.maurer@gmail.com>",
|
"Max Maurer <maxemanuel.maurer@gmail.com>",
|
||||||
|
"Maximilian Haupt <mail@maximilianhaupt.com>",
|
||||||
"Michael Hess <mhess@connectify.me>",
|
"Michael Hess <mhess@connectify.me>",
|
||||||
"naoh <noreply@github.com>",
|
"naoh <naoh.cs03g@nctu.edu.tw>",
|
||||||
"Nik Rolls <nik@rolls.cc>",
|
"Nik Rolls <nik@rolls.cc>",
|
||||||
|
"Nikhil Motiani <nikhil.m@247-inc.com>",
|
||||||
"niris <nirisix@gmail.com>",
|
"niris <nirisix@gmail.com>",
|
||||||
|
"Nobuo Okada <nookada@yahoo-corp.jp>",
|
||||||
"otakuSiD <otakusid@gmail.com>",
|
"otakuSiD <otakusid@gmail.com>",
|
||||||
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
|
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
|
||||||
"philippsimon <github@philippsimon.de>",
|
"philippsimon <github@philippsimon.de>",
|
||||||
"Pieter Hendrickx <pieter.hendrickx@belfius.be>",
|
"Pieter Hendrickx <pieter.hendrickx@belfius.be>",
|
||||||
|
"Piper Chester <piperchester@gmail.com>",
|
||||||
"Robert Tod <robert@qubit.com>",
|
"Robert Tod <robert@qubit.com>",
|
||||||
|
"Ron Korland <ron@testim.io>",
|
||||||
"Ross Noble <rosshnoble@gmail.com>",
|
"Ross Noble <rosshnoble@gmail.com>",
|
||||||
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
|
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
|
||||||
"sgautrea <shanegautreau@gmail.com>",
|
"sgautrea <shanegautreau@gmail.com>",
|
||||||
"Shane Gautreau <sgautrea@opentext.com>",
|
"Shane Gautreau <sgautrea@opentext.com>",
|
||||||
"Shane Thacker <shane@steadymade.com>",
|
"Shane Thacker <shane@steadymade.com>",
|
||||||
|
"shchotse <topal@mail.ua>",
|
||||||
"Simon Eisenmann <simon@longsleep.org>",
|
"Simon Eisenmann <simon@longsleep.org>",
|
||||||
"Simon Lang <me@simonlang.org>",
|
"Simon Lang <me@simonlang.org>",
|
||||||
|
"Stiekel <histkc@gmail.com>",
|
||||||
"Sylvain Gizard <sylvain.gizard@gmail.com>",
|
"Sylvain Gizard <sylvain.gizard@gmail.com>",
|
||||||
"szchenghuang <szchenghuang@gmail.com>",
|
"szchenghuang <szchenghuang@gmail.com>",
|
||||||
"Vadim Kurachevsky <vadim@hmvs.org>",
|
"Vadim Kurachevsky <vadim@hmvs.org>",
|
||||||
@ -84,8 +105,6 @@
|
|||||||
},
|
},
|
||||||
"verup": {
|
"verup": {
|
||||||
"files": [
|
"files": [
|
||||||
"ua-parser-js.jquery.json",
|
|
||||||
"component.json",
|
|
||||||
"bower.json",
|
"bower.json",
|
||||||
"package.js",
|
"package.js",
|
||||||
"src/ua-parser.js"
|
"src/ua-parser.js"
|
||||||
@ -114,5 +133,8 @@
|
|||||||
"dist": "dist",
|
"dist": "dist",
|
||||||
"src": "src",
|
"src": "src",
|
||||||
"test": "test"
|
"test": "test"
|
||||||
}
|
},
|
||||||
|
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
||||||
|
"demo": "https://faisalman.github.io/ua-parser-js",
|
||||||
|
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
|
||||||
}
|
}
|
||||||
|
107
readme.md
107
readme.md
@ -1,15 +1,14 @@
|
|||||||
# UAParser.js
|
# UAParser.js
|
||||||
|
|
||||||
<img align="right" src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/logo.png"> A JavaScript-based User-Agent string parser. Can be used either in browser (client-side) or in node.js (server-side) environment. Also available as jQuery/Zepto plugin, Bower/Meteor package, & RequireJS/AMD module. This library aims to identify detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model, entirely from user-agent string with a relatively small footprint (~11KB when minified / ~4KB gzipped). Written in vanilla JavaScript, which means it doesn't require any other library and can be used independently. However, it's not recommended to use this library as browser detection since the result may not accurate than using feature detection.
|
<img align="right" src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/logo.png"> A JavaScript-based User-Agent string parser. Can be used either in browser (client-side) or in node.js (server-side) environment. Also available as jQuery/Zepto plugin, Bower/Meteor package, & RequireJS/AMD module. This library aims to identify detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model, entirely from user-agent string with a relatively small footprint (~17KB when minified / ~6KB gzipped). Written in vanilla JavaScript, which means it doesn't require any other library and can be used independently. However, it's not recommended to use this library as browser detection since the result may not be more accurate than using feature detection.
|
||||||
|
|
||||||
[](https://travis-ci.org/faisalman/ua-parser-js)
|
[](https://travis-ci.org/faisalman/ua-parser-js)
|
||||||
|
[](https://www.npmjs.com/package/ua-parser-js)
|
||||||
[](https://www.npmjs.com/package/ua-parser-js)
|
[](https://www.npmjs.com/package/ua-parser-js)
|
||||||
[](https://bower.io/)
|
[](https://bower.io/)
|
||||||
[](https://cdnjs.com/libraries/UAParser.js)
|
[](https://cdnjs.com/libraries/UAParser.js)
|
||||||
[](https://gratipay.com/UAParser.js)
|
|
||||||
[](http://flattr.com/thing/3867907/faisalmanua-parser-js-on-GitHub)
|
|
||||||
|
|
||||||
* Author : Faisal Salman <<fyzlman@gmail.com>>
|
* Author : Faisal Salman <<f@faisalman.com>>
|
||||||
* Demo : http://faisalman.github.io/ua-parser-js
|
* Demo : http://faisalman.github.io/ua-parser-js
|
||||||
* Source : https://github.com/faisalman/ua-parser-js
|
* Source : https://github.com/faisalman/ua-parser-js
|
||||||
|
|
||||||
@ -26,16 +25,21 @@
|
|||||||
* `getBrowser()`
|
* `getBrowser()`
|
||||||
* returns `{ name: '', version: '' }`
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# Possible 'browser.name':
|
# Possible 'browser.name':
|
||||||
Amaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Bowser, Camino, Chimera,
|
2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu,
|
||||||
Chrome [WebView], Chromium, Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Edge,
|
Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless,
|
||||||
Epiphany, Fennec, Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe,
|
Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Dolphin, Doris, Edge,
|
||||||
IceCat, IceDragon, Iceweasel, IE[Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle,
|
Epiphany, Facebook, Falkon, Fennec, Firebird, Firefox, Flock, GSA, GoBrowser,
|
||||||
Links, Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari,
|
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceape, Iceweasel,
|
||||||
Mosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet],
|
Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror, LBBROWSER Line, Links,
|
||||||
PhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, Sleipnir,
|
Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon, MetaSr Midori,
|
||||||
SlimBrowser, Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, WeChat, Yandex
|
Minimo, Mobile Safari, Mosaic, Mozilla, NetFront, NetSurf, Netfront, Netscape,
|
||||||
|
NokiaBrowser, Oculus Browser, OmniWeb, Opera Coast, Opera Mini, Opera Mobi,
|
||||||
|
Opera Tablet, Opera, PaleMoon, PhantomJS, Phoenix, Polaris, Puffin, QQ,
|
||||||
|
QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, Samsung Browser,
|
||||||
|
SeaMonkey, Silk, Skyfire, Sleipnir, Slim, SlimBrowser, Swiftfox, Tizen Browser,
|
||||||
|
UCBrowser, Vivaldi, Waterfox, WeChat, Yandex, baidu, iCab, w3m, ...
|
||||||
|
|
||||||
# 'browser.version' determined dynamically
|
# 'browser.version' determined dynamically
|
||||||
```
|
```
|
||||||
@ -43,15 +47,15 @@ SlimBrowser, Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, WeChat, Yandex
|
|||||||
* `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
|
||||||
|
|
||||||
# Possible 'device.vendor':
|
# Possible 'device.vendor':
|
||||||
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone,
|
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, Essential,
|
||||||
Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian,
|
GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola,
|
||||||
Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron, RIM,
|
Nexian, Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron,
|
||||||
Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE
|
RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ...
|
||||||
|
|
||||||
# 'device.model' determined dynamically
|
# 'device.model' determined dynamically
|
||||||
```
|
```
|
||||||
@ -59,10 +63,10 @@ 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, Blink, EdgeHTML, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, NetSurf,
|
||||||
Tasman, Trident, w3m, WebKit
|
Presto, Tasman, Trident, w3m, WebKit
|
||||||
|
|
||||||
# 'engine.version' determined dynamically
|
# 'engine.version' determined dynamically
|
||||||
```
|
```
|
||||||
@ -70,14 +74,14 @@ 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, Fuchsia, Gentoo, GNU, Haiku, Hurd, iOS,
|
||||||
Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,
|
Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,
|
||||||
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, Playstation, QNX, RedHat,
|
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, Playstation, QNX, RedHat,
|
||||||
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
|
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
|
||||||
Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk
|
Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
|
||||||
|
|
||||||
# 'os.version' determined dynamically
|
# 'os.version' determined dynamically
|
||||||
```
|
```
|
||||||
@ -85,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]
|
||||||
```
|
```
|
||||||
@ -211,6 +215,12 @@ requirejs(['ua-parser-js'], function(UAParser) {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Using CDN
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@0/dist/ua-parser.min.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
## Using bower
|
## Using bower
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -223,6 +233,26 @@ $ 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
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ node ua-parser.min.js "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)"
|
||||||
|
# multiple args
|
||||||
|
$ node ua-parser.min.js "Opera/1.2" "Opera/3.4"
|
||||||
|
# piped args
|
||||||
|
$ echo "Opera/1.2" | node ua-parser.min.js
|
||||||
|
# log file
|
||||||
|
$ cat ua.log | node ua-parser.min.js
|
||||||
|
```
|
||||||
|
|
||||||
## Using jQuery/Zepto ($.ua)
|
## Using jQuery/Zepto ($.ua)
|
||||||
|
|
||||||
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto 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)`.
|
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto 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)`.
|
||||||
@ -252,16 +282,16 @@ $('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.
|
|||||||
|
|
||||||
## Extending regex patterns
|
## Extending regex patterns
|
||||||
|
|
||||||
* `UAParser(uastring[, extensions])`
|
* `UAParser([uastring,] extensions)`
|
||||||
|
|
||||||
Pass your own regexes to extend the limited matching rules.
|
Pass your own regexes to extend the limited matching rules.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Example:
|
// Example:
|
||||||
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
|
|
||||||
var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
|
var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
|
||||||
var parser = new UAParser(uaString, { browser: myOwnRegex });
|
var myParser = new UAParser({ browser: myOwnRegex });
|
||||||
console.log(parser.getBrowser()); // {name: "MyOwnBrowser", version: "1.3"}
|
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
|
||||||
|
console.log(myParser.setUA(uaString).getBrowser()); // {name: "MyOwnBrowser", version: "1.3"}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -286,11 +316,18 @@ $ npm run build
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Donate
|
||||||
|
|
||||||
|
Do you use & like UAParser.js but you don’t find a way to show some love? If yes, please consider donating to support this project. Otherwise, no worries, regardless of whether there is support or not, I will keep maintaining this project. Still, if you buy me a cup of coffee I would be more than happy though :)
|
||||||
|
|
||||||
|
[](https://www.paypal.me/faisalman/)
|
||||||
|
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
Dual licensed under GPLv2 & MIT
|
Dual licensed under GPLv2 or MIT
|
||||||
|
|
||||||
Copyright © 2012-2016 Faisal Salman <<fyzlman@gmail.com>>
|
Copyright © 2012-2018 Faisal Salman <<f@faisalman.com>>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
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
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
@ -301,3 +338,11 @@ subject to the following conditions:
|
|||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
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.
|
||||||
|
347
src/ua-parser.js
Normal file → Executable file
347
src/ua-parser.js
Normal file → Executable file
@ -1,10 +1,10 @@
|
|||||||
/**
|
/*!
|
||||||
* UAParser.js v0.7.12
|
* UAParser.js v0.7.19
|
||||||
* Lightweight JavaScript-based User-Agent string parser
|
* Lightweight JavaScript-based User-Agent string parser
|
||||||
* https://github.com/faisalman/ua-parser-js
|
* https://github.com/faisalman/ua-parser-js
|
||||||
*
|
*
|
||||||
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
||||||
* Dual licensed under GPLv2 & MIT
|
* Dual licensed under GPLv2 or MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (window, undefined) {
|
(function (window, undefined) {
|
||||||
@ -16,7 +16,7 @@
|
|||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
|
|
||||||
var LIBVERSION = '0.7.12',
|
var LIBVERSION = '0.7.19',
|
||||||
EMPTY = '',
|
EMPTY = '',
|
||||||
UNKNOWN = '?',
|
UNKNOWN = '?',
|
||||||
FUNC_TYPE = 'function',
|
FUNC_TYPE = 'function',
|
||||||
@ -244,7 +244,7 @@
|
|||||||
|
|
||||||
// Mixed
|
// Mixed
|
||||||
/(kindle)\/([\w\.]+)/i, // Kindle
|
/(kindle)\/([\w\.]+)/i, // Kindle
|
||||||
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,
|
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,
|
||||||
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
||||||
|
|
||||||
// Trident based
|
// Trident based
|
||||||
@ -253,20 +253,35 @@
|
|||||||
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
|
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
|
||||||
|
|
||||||
// Webkit/KHTML based
|
// Webkit/KHTML based
|
||||||
/(rekonq)\/([\w\.]+)*/i, // Rekonq
|
/(rekonq)\/([\w\.]*)/i, // Rekonq
|
||||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser)\/([\w\.-]+)/i
|
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i
|
||||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser
|
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(konqueror)\/([\w\.]+)/i // Konqueror
|
||||||
|
], [[NAME, 'Konqueror'], VERSION], [
|
||||||
|
|
||||||
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
|
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
|
||||||
], [[NAME, 'IE'], VERSION], [
|
], [[NAME, 'IE'], VERSION], [
|
||||||
|
|
||||||
/(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge
|
/(edge|edgios|edga)\/((\d+)?[\w\.]+)/i // Microsoft Edge
|
||||||
], [NAME, VERSION], [
|
], [[NAME, 'Edge'], VERSION], [
|
||||||
|
|
||||||
/(yabrowser)\/([\w\.]+)/i // Yandex
|
/(yabrowser)\/([\w\.]+)/i // Yandex
|
||||||
], [[NAME, 'Yandex'], VERSION], [
|
], [[NAME, 'Yandex'], VERSION], [
|
||||||
|
|
||||||
|
/(puffin)\/([\w\.]+)/i // Puffin
|
||||||
|
], [[NAME, 'Puffin'], VERSION], [
|
||||||
|
|
||||||
|
/(focus)\/([\w\.]+)/i // Firefox Focus
|
||||||
|
], [[NAME, 'Firefox Focus'], VERSION], [
|
||||||
|
|
||||||
|
/(opt)\/([\w\.]+)/i // Opera Touch
|
||||||
|
], [[NAME, 'Opera Touch'], VERSION], [
|
||||||
|
|
||||||
|
/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i // UCBrowser
|
||||||
|
], [[NAME, 'UCBrowser'], VERSION], [
|
||||||
|
|
||||||
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
|
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
|
||||||
], [[NAME, /_/g, ' '], VERSION], [
|
], [[NAME, /_/g, ' '], VERSION], [
|
||||||
|
|
||||||
@ -276,19 +291,49 @@
|
|||||||
/(micromessenger)\/([\w\.]+)/i // WeChat
|
/(micromessenger)\/([\w\.]+)/i // WeChat
|
||||||
], [[NAME, 'WeChat'], VERSION], [
|
], [[NAME, 'WeChat'], VERSION], [
|
||||||
|
|
||||||
|
/(brave)\/([\w\.]+)/i // Brave browser
|
||||||
|
], [[NAME, 'Brave'], VERSION], [
|
||||||
|
|
||||||
|
/(qqbrowserlite)\/([\w\.]+)/i // QQBrowserLite
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
/(QQ)\/([\d\.]+)/i // QQ, aka ShouQ
|
/(QQ)\/([\d\.]+)/i // QQ, aka ShouQ
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
/m?(qqbrowser)[\/\s]?([\w\.]+)/i // QQBrowser
|
/m?(qqbrowser)[\/\s]?([\w\.]+)/i // QQBrowser
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(BIDUBrowser)[\/\s]?([\w\.]+)/i // Baidu Browser
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(2345Explorer)[\/\s]?([\w\.]+)/i // 2345 Browser
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(MetaSr)[\/\s]?([\w\.]+)/i // SouGouBrowser
|
||||||
|
], [NAME], [
|
||||||
|
|
||||||
|
/(LBBROWSER)/i // LieBao Browser
|
||||||
|
], [NAME], [
|
||||||
|
|
||||||
/xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser
|
/xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser
|
||||||
], [VERSION, [NAME, 'MIUI Browser']], [
|
], [VERSION, [NAME, 'MIUI Browser']], [
|
||||||
|
|
||||||
|
/;fbav\/([\w\.]+);/i // Facebook App for iOS & Android
|
||||||
|
], [VERSION, [NAME, 'Facebook']], [
|
||||||
|
|
||||||
|
/safari\s(line)\/([\w\.]+)/i, // Line App for iOS
|
||||||
|
/android.+(line)\/([\w\.]+)\/iab/i // Line App for Android
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/headlesschrome(?:\/([\w\.]+)|\s)/i // Chrome Headless
|
||||||
|
], [VERSION, [NAME, 'Chrome Headless']], [
|
||||||
|
|
||||||
/\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView
|
/\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView
|
||||||
], [[NAME, /(.+)/, '$1 WebView'], VERSION], [
|
], [[NAME, /(.+)/, '$1 WebView'], VERSION], [
|
||||||
|
|
||||||
/android.+samsungbrowser\/([\w\.]+)/i,
|
/((?:oculus|samsung)browser)\/([\w\.]+)/i
|
||||||
|
], [[NAME, /(.+(?:g|us))(.+)/, '$1 $2'], VERSION], [ // Oculus / Samsung Browser
|
||||||
|
|
||||||
/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser
|
/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser
|
||||||
], [VERSION, [NAME, 'Android Browser']], [
|
], [VERSION, [NAME, 'Android Browser']], [
|
||||||
|
|
||||||
@ -296,20 +341,14 @@
|
|||||||
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
/(uc\s?browser)[\/\s]?([\w\.]+)/i,
|
|
||||||
/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,
|
|
||||||
/juc.+(ucweb)[\/\s]?([\w\.]+)/i
|
|
||||||
// UCBrowser
|
|
||||||
], [[NAME, 'UCBrowser'], VERSION], [
|
|
||||||
|
|
||||||
/(dolfin)\/([\w\.]+)/i // Dolphin
|
/(dolfin)\/([\w\.]+)/i // Dolphin
|
||||||
], [[NAME, 'Dolphin'], VERSION], [
|
], [[NAME, 'Dolphin'], VERSION], [
|
||||||
|
|
||||||
/((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
|
/((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
|
||||||
], [[NAME, 'Chrome'], VERSION], [
|
], [[NAME, 'Chrome'], VERSION], [
|
||||||
|
|
||||||
/;fbav\/([\w\.]+);/i // Facebook App for iOS
|
/(coast)\/([\w\.]+)/i // Opera Coast
|
||||||
], [VERSION, [NAME, 'Facebook']], [
|
], [[NAME, 'Opera Coast'], VERSION], [
|
||||||
|
|
||||||
/fxios\/([\w\.-]+)/i // Firefox for iOS
|
/fxios\/([\w\.-]+)/i // Firefox for iOS
|
||||||
], [VERSION, [NAME, 'Firefox']], [
|
], [VERSION, [NAME, 'Firefox']], [
|
||||||
@ -320,10 +359,12 @@
|
|||||||
/version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
|
/version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
|
||||||
], [VERSION, NAME], [
|
], [VERSION, NAME], [
|
||||||
|
|
||||||
|
/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Google Search Appliance on iOS
|
||||||
|
], [[NAME, 'GSA'], VERSION], [
|
||||||
|
|
||||||
/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
|
/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
|
||||||
], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [
|
], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [
|
||||||
|
|
||||||
/(konqueror)\/([\w\.]+)/i, // Konqueror
|
|
||||||
/(webkit|khtml)\/([\w\.]+)/i
|
/(webkit|khtml)\/([\w\.]+)/i
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
@ -333,7 +374,8 @@
|
|||||||
/(swiftfox)/i, // Swiftfox
|
/(swiftfox)/i, // Swiftfox
|
||||||
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
|
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
|
||||||
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
||||||
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,
|
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,
|
||||||
|
|
||||||
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
||||||
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
|
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
|
||||||
|
|
||||||
@ -341,7 +383,7 @@
|
|||||||
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
|
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
|
||||||
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
|
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
|
||||||
/(links)\s\(([\w\.]+)/i, // Links
|
/(links)\s\(([\w\.]+)/i, // Links
|
||||||
/(gobrowser)\/?([\w\.]+)*/i, // GoBrowser
|
/(gobrowser)\/?([\w\.]*)/i, // GoBrowser
|
||||||
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
|
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
|
||||||
/(mosaic)[\/\s]([\w\.]+)/i // Mosaic
|
/(mosaic)[\/\s]([\w\.]+)/i // Mosaic
|
||||||
], [NAME, VERSION]
|
], [NAME, VERSION]
|
||||||
@ -479,14 +521,14 @@
|
|||||||
/(sun4\w)[;\)]/i // SPARC
|
/(sun4\w)[;\)]/i // SPARC
|
||||||
], [[ARCHITECTURE, 'sparc']], [
|
], [[ARCHITECTURE, 'sparc']], [
|
||||||
|
|
||||||
/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
||||||
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
||||||
], [[ARCHITECTURE, util.lowerize]]
|
], [[ARCHITECTURE, util.lowerize]]
|
||||||
],
|
],
|
||||||
|
|
||||||
device : [[
|
device : [[
|
||||||
|
|
||||||
/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook
|
/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i // iPad/PlayBook
|
||||||
], [MODEL, VENDOR, [TYPE, TABLET]], [
|
], [MODEL, VENDOR, [TYPE, TABLET]], [
|
||||||
|
|
||||||
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
|
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
|
||||||
@ -503,10 +545,12 @@
|
|||||||
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
|
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
|
||||||
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i // Kindle Fire HD
|
/(kf[A-z]+)\sbuild\/.+silk\//i // Kindle Fire HD
|
||||||
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
|
||||||
/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i // Fire Phone
|
/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i // Fire Phone
|
||||||
], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [
|
], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [
|
||||||
|
/android.+aft([bms])\sbuild/i // Fire TV
|
||||||
|
], [MODEL, [VENDOR, 'Amazon'], [TYPE, SMARTTV]], [
|
||||||
|
|
||||||
/\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone
|
/\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone
|
||||||
], [MODEL, VENDOR, [TYPE, MOBILE]], [
|
], [MODEL, VENDOR, [TYPE, MOBILE]], [
|
||||||
@ -514,22 +558,22 @@
|
|||||||
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
|
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
|
||||||
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,
|
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,
|
||||||
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Huawei/Meizu/Motorola/Polytron
|
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
|
||||||
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
|
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
|
||||||
/(asus)-?(\w+)/i // Asus
|
/(asus)-?(\w+)/i // Asus
|
||||||
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
||||||
/\(bb10;\s(\w+)/i // BlackBerry 10
|
/\(bb10;\s(\w+)/i // BlackBerry 10
|
||||||
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
|
||||||
// Asus Tablets
|
// Asus Tablets
|
||||||
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i
|
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i
|
||||||
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
|
/(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
|
||||||
/(sony)?(?:sgp.+)\sbuild\//i
|
/(sony)?(?:sgp.+)\sbuild\//i
|
||||||
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [
|
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [
|
||||||
/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i
|
/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
||||||
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Phone'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/\s(ouya)\s/i, // Ouya
|
/\s(ouya)\s/i, // Ouya
|
||||||
/(nintendo)\s([wids3u]+)/i // Nintendo
|
/(nintendo)\s([wids3u]+)/i // Nintendo
|
||||||
@ -547,16 +591,17 @@
|
|||||||
/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
|
/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
|
||||||
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
|
/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC
|
||||||
/(zte)-(\w+)*/i, // ZTE
|
/(zte)-(\w*)/i, // ZTE
|
||||||
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
|
/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i
|
||||||
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
// Alcatel/GeeksPhone/Lenovo/Nexian/Panasonic/Sony
|
||||||
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(nexus\s9)/i // HTC Nexus 9
|
/(nexus\s9)/i // HTC Nexus 9
|
||||||
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(nexus\s6p)/i // Huawei Nexus 6P
|
/d\/huawei([\w\s-]+)[;\)]/i,
|
||||||
|
/(nexus\s6p)/i // Huawei
|
||||||
], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia
|
/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia
|
||||||
@ -568,8 +613,8 @@
|
|||||||
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
|
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
// Motorola
|
// Motorola
|
||||||
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,
|
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,
|
||||||
/mot[\s-]?(\w+)*/i,
|
/mot[\s-]?(\w*)/i,
|
||||||
/(XT\d{3,4}) build\//i,
|
/(XT\d{3,4}) build\//i,
|
||||||
/(nexus\s6)/i
|
/(nexus\s6)/i
|
||||||
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
|
||||||
@ -591,26 +636,29 @@
|
|||||||
/smart-tv.+(samsung)/i
|
/smart-tv.+(samsung)/i
|
||||||
], [VENDOR, [TYPE, SMARTTV], MODEL], [
|
], [VENDOR, [TYPE, SMARTTV], MODEL], [
|
||||||
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,
|
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,
|
||||||
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
|
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,
|
||||||
/sec-((sgh\w+))/i
|
/sec-((sgh\w+))/i
|
||||||
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
|
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/sie-(\w+)*/i // Siemens
|
/sie-(\w*)/i // Siemens
|
||||||
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
|
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
|
||||||
/(nokia)[\s_-]?([\w-]+)*/i
|
/(nokia)[\s_-]?([\w-]*)/i
|
||||||
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
|
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/android\s3\.[\s\w;-]{10}(a\d{3})/i // Acer
|
/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i // Acer
|
||||||
], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+([vl]k\-?\d{3})\s+build/i // LG Tablet
|
||||||
|
], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [
|
||||||
/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
|
/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
|
||||||
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
|
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
|
||||||
/(lg) netcast\.tv/i // LG SmartTV
|
/(lg) netcast\.tv/i // LG SmartTV
|
||||||
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
|
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
|
||||||
/(nexus\s[45])/i, // LG
|
/(nexus\s[45])/i, // LG
|
||||||
/lg[e;\s\/-]+(\w+)*/i
|
/lg[e;\s\/-]+(\w*)/i,
|
||||||
|
/android.+lg(\-?[\d\w]+)\s+build/i
|
||||||
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
|
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
|
||||||
@ -625,26 +673,111 @@
|
|||||||
/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO
|
/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO
|
||||||
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/crkey/i // Google Chromecast
|
||||||
|
], [[MODEL, 'Chromecast'], [VENDOR, 'Google']], [
|
||||||
|
|
||||||
/android.+;\s(glass)\s\d/i // Google Glass
|
/android.+;\s(glass)\s\d/i // Google Glass
|
||||||
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
|
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
|
||||||
|
|
||||||
/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 xl|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.+(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
|
/android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
|
||||||
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
|
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
|
||||||
/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i // Xiaomi Mi
|
/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i, // Xiaomi Mi
|
||||||
|
/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i // Redmi Phones
|
||||||
], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [
|
], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [
|
||||||
|
/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i // Mi Pad tablets
|
||||||
|
],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [
|
||||||
|
/android.+;\s(m[1-5]\snote)\sbuild/i // Meizu Tablet
|
||||||
|
], [MODEL, [VENDOR, 'Meizu'], [TYPE, TABLET]], [
|
||||||
|
/(mz)-([\w-]{2,})/i // Meizu Phone
|
||||||
|
], [[VENDOR, 'Meizu'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/android.+a000(1)\s+build/i // OnePlus
|
/android.+a000(1)\s+build/i, // OnePlus
|
||||||
|
/android.+oneplus\s(a\d{4})\s+build/i
|
||||||
], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/\s(tablet)[;\/]/i, // Unidentifiable Tablet
|
/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i // RCA Tablets
|
||||||
|
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i // Dell Venue Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i // Verizon Tablet
|
||||||
|
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i // Barnes & Noble Tablet
|
||||||
|
], [[VENDOR, 'Barnes & Noble'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i // Barnes & Noble Tablet
|
||||||
|
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+;\s(k88)\sbuild/i // ZTE K Series Tablet
|
||||||
|
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i // Swiss GEN Mobile
|
||||||
|
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(zur\d{3})\s+build/i // Swiss ZUR Tablet
|
||||||
|
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i // Zeki Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(android).+[;\/]\s+([YR]\d{2})\s+build/i,
|
||||||
|
/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i // Dragon Touch Tablet
|
||||||
|
], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i // Insignia Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i // NextBook Tablets
|
||||||
|
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i
|
||||||
|
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i // LvTel Phones
|
||||||
|
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/android.+;\s(PH-1)\s/i
|
||||||
|
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ // Essential PH-1
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i // Envizen Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i // Le Pan Tablets
|
||||||
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i // MachSpeed Tablets
|
||||||
|
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i // Trinity Tablets
|
||||||
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+[;\/]\s*TU_(1491)\s+build/i // Rotor Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+(KS(.+))\s+build/i // Amazon Kindle Tablets
|
||||||
|
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i // Gigaset Tablets
|
||||||
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/\s(tablet|tab)[;\/]/i, // Unidentifiable Tablet
|
||||||
/\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile
|
/\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile
|
||||||
], [[TYPE, util.lowerize], VENDOR, MODEL]
|
], [[TYPE, util.lowerize], VENDOR, MODEL], [
|
||||||
|
|
||||||
|
/[\s\/\(](smart-?tv)[;\)]/i // SmartTV
|
||||||
|
], [[TYPE, SMARTTV]], [
|
||||||
|
|
||||||
|
/(android[\w\.\s\-]{0,9});.+build/i // Generic Android Device
|
||||||
|
], [MODEL, [VENDOR, 'Generic']]
|
||||||
|
|
||||||
|
|
||||||
/*//////////////////////////
|
/*//////////////////////////
|
||||||
// TODO: move to string map
|
// TODO: move to string map
|
||||||
@ -703,13 +836,17 @@
|
|||||||
/windows.+\sedge\/([\w\.]+)/i // EdgeHTML
|
/windows.+\sedge\/([\w\.]+)/i // EdgeHTML
|
||||||
], [VERSION, [NAME, 'EdgeHTML']], [
|
], [VERSION, [NAME, 'EdgeHTML']], [
|
||||||
|
|
||||||
|
/webkit\/537\.36.+chrome\/(?!27)/i // Blink
|
||||||
|
], [[NAME, 'Blink']], [
|
||||||
|
|
||||||
/(presto)\/([\w\.]+)/i, // Presto
|
/(presto)\/([\w\.]+)/i, // Presto
|
||||||
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
|
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
|
||||||
|
// WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
||||||
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
||||||
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
|
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
/rv\:([\w\.]+).*(gecko)/i // Gecko
|
/rv\:([\w\.]{1,9}).+(gecko)/i // Gecko
|
||||||
], [VERSION, NAME]
|
], [VERSION, NAME]
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -719,7 +856,7 @@
|
|||||||
/microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes)
|
/microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes)
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
|
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
|
||||||
/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i, // Windows Phone
|
/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone
|
||||||
/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
|
/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
|
||||||
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
|
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
|
||||||
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
|
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
|
||||||
@ -728,13 +865,13 @@
|
|||||||
// Mobile/Embedded OS
|
// Mobile/Embedded OS
|
||||||
/\((bb)(10);/i // BlackBerry 10
|
/\((bb)(10);/i // BlackBerry 10
|
||||||
], [[NAME, 'BlackBerry'], VERSION], [
|
], [[NAME, 'BlackBerry'], VERSION], [
|
||||||
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
|
/(blackberry)\w*\/?([\w\.]*)/i, // Blackberry
|
||||||
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
|
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
|
||||||
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
|
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,
|
||||||
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
|
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
|
||||||
/linux;.+(sailfish);/i // Sailfish OS
|
/linux;.+(sailfish);/i // Sailfish OS
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
|
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i // Symbian
|
||||||
], [[NAME, 'Symbian'], VERSION], [
|
], [[NAME, 'Symbian'], VERSION], [
|
||||||
/\((series40);/i // Series 40
|
/\((series40);/i // Series 40
|
||||||
], [NAME], [
|
], [NAME], [
|
||||||
@ -745,42 +882,43 @@
|
|||||||
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
|
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
|
||||||
|
|
||||||
// GNU/Linux based
|
// GNU/Linux based
|
||||||
/(mint)[\/\s\(]?(\w+)*/i, // Mint
|
/(mint)[\/\s\(]?(\w*)/i, // Mint
|
||||||
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
|
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
|
||||||
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,
|
/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,
|
||||||
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
||||||
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
|
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
|
||||||
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
|
/(hurd|linux)\s?([\w\.]*)/i, // Hurd/Linux
|
||||||
/(gnu)\s?([\w\.]+)*/i // GNU
|
/(gnu)\s?([\w\.]*)/i // GNU
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
|
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
|
||||||
], [[NAME, 'Chromium OS'], VERSION],[
|
], [[NAME, 'Chromium OS'], VERSION],[
|
||||||
|
|
||||||
// Solaris
|
// Solaris
|
||||||
/(sunos)\s?([\w\.]+\d)*/i // Solaris
|
/(sunos)\s?([\w\.\d]*)/i // Solaris
|
||||||
], [[NAME, 'Solaris'], VERSION], [
|
], [[NAME, 'Solaris'], VERSION], [
|
||||||
|
|
||||||
// BSD based
|
// BSD based
|
||||||
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
|
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
|
||||||
], [NAME, VERSION],[
|
], [NAME, VERSION],[
|
||||||
|
|
||||||
/(haiku)\s(\w+)/i // Haiku
|
/(haiku)\s(\w+)/i // Haiku
|
||||||
], [NAME, VERSION],[
|
], [NAME, VERSION],[
|
||||||
|
|
||||||
/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i // iOS
|
/cfnetwork\/.+darwin/i,
|
||||||
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
|
/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i // iOS
|
||||||
|
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
|
||||||
|
|
||||||
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,
|
/(mac\sos\sx)\s?([\w\s\.]*)/i,
|
||||||
/(macintosh|mac(?=_powerpc)\s)/i // Mac OS
|
/(macintosh|mac(?=_powerpc)\s)/i // Mac OS
|
||||||
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
|
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris
|
/((?:open)?solaris)[\/\s-]?([\w\.]*)/i, // Solaris
|
||||||
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
|
/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, // AIX
|
||||||
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,
|
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,
|
||||||
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS
|
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS/Fuchsia
|
||||||
/(unix)\s?([\w\.]+)*/i // UNIX
|
/(unix)\s?([\w\.]*)/i // UNIX
|
||||||
], [NAME, VERSION]
|
], [NAME, VERSION]
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@ -789,7 +927,7 @@
|
|||||||
/////////////////
|
/////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
////////////////
|
////////////////
|
||||||
|
/*
|
||||||
var Browser = function (name, version) {
|
var Browser = function (name, version) {
|
||||||
this[NAME] = name;
|
this[NAME] = name;
|
||||||
this[VERSION] = version;
|
this[VERSION] = version;
|
||||||
@ -804,39 +942,49 @@
|
|||||||
};
|
};
|
||||||
var Engine = Browser;
|
var Engine = Browser;
|
||||||
var OS = Browser;
|
var OS = Browser;
|
||||||
|
*/
|
||||||
var UAParser = function (uastring, extensions) {
|
var UAParser = function (uastring, extensions) {
|
||||||
|
|
||||||
|
if (typeof uastring === 'object') {
|
||||||
|
extensions = uastring;
|
||||||
|
uastring = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(this instanceof UAParser)) {
|
if (!(this instanceof UAParser)) {
|
||||||
return new UAParser(uastring, extensions).getResult();
|
return new UAParser(uastring, extensions).getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
|
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
|
||||||
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
|
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
|
||||||
var browser = new Browser();
|
//var browser = new Browser();
|
||||||
var cpu = new CPU();
|
//var cpu = new CPU();
|
||||||
var device = new Device();
|
//var device = new Device();
|
||||||
var engine = new Engine();
|
//var engine = new Engine();
|
||||||
var os = new OS();
|
//var os = new OS();
|
||||||
|
|
||||||
this.getBrowser = function () {
|
this.getBrowser = function () {
|
||||||
|
var browser = { name: undefined, version: undefined };
|
||||||
mapper.rgx.call(browser, ua, rgxmap.browser);
|
mapper.rgx.call(browser, ua, rgxmap.browser);
|
||||||
browser.major = util.major(browser.version); // deprecated
|
browser.major = util.major(browser.version); // deprecated
|
||||||
return browser;
|
return browser;
|
||||||
};
|
};
|
||||||
this.getCPU = function () {
|
this.getCPU = function () {
|
||||||
|
var cpu = { architecture: undefined };
|
||||||
mapper.rgx.call(cpu, ua, rgxmap.cpu);
|
mapper.rgx.call(cpu, ua, rgxmap.cpu);
|
||||||
return cpu;
|
return cpu;
|
||||||
};
|
};
|
||||||
this.getDevice = function () {
|
this.getDevice = function () {
|
||||||
|
var device = { vendor: undefined, model: undefined, type: undefined };
|
||||||
mapper.rgx.call(device, ua, rgxmap.device);
|
mapper.rgx.call(device, ua, rgxmap.device);
|
||||||
return device;
|
return device;
|
||||||
};
|
};
|
||||||
this.getEngine = function () {
|
this.getEngine = function () {
|
||||||
|
var engine = { name: undefined, version: undefined };
|
||||||
mapper.rgx.call(engine, ua, rgxmap.engine);
|
mapper.rgx.call(engine, ua, rgxmap.engine);
|
||||||
return engine;
|
return engine;
|
||||||
};
|
};
|
||||||
this.getOS = function () {
|
this.getOS = function () {
|
||||||
|
var os = { name: undefined, version: undefined };
|
||||||
mapper.rgx.call(os, ua, rgxmap.os);
|
mapper.rgx.call(os, ua, rgxmap.os);
|
||||||
return os;
|
return os;
|
||||||
};
|
};
|
||||||
@ -855,11 +1003,11 @@
|
|||||||
};
|
};
|
||||||
this.setUA = function (uastring) {
|
this.setUA = function (uastring) {
|
||||||
ua = uastring;
|
ua = uastring;
|
||||||
browser = new Browser();
|
//browser = new Browser();
|
||||||
cpu = new CPU();
|
//cpu = new CPU();
|
||||||
device = new Device();
|
//device = new Device();
|
||||||
engine = new Engine();
|
//engine = new Engine();
|
||||||
os = new OS();
|
//os = new OS();
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
return this;
|
return this;
|
||||||
@ -906,6 +1054,35 @@
|
|||||||
if (typeof module !== UNDEF_TYPE && module.exports) {
|
if (typeof module !== UNDEF_TYPE && module.exports) {
|
||||||
exports = module.exports = UAParser;
|
exports = module.exports = UAParser;
|
||||||
}
|
}
|
||||||
|
// TODO: test!!!!!!!!
|
||||||
|
/*
|
||||||
|
if (require && require.main === module && process) {
|
||||||
|
// cli
|
||||||
|
var jsonize = function (arr) {
|
||||||
|
var res = [];
|
||||||
|
for (var i in arr) {
|
||||||
|
res.push(new UAParser(arr[i]).getResult());
|
||||||
|
}
|
||||||
|
process.stdout.write(JSON.stringify(res, null, 2) + '\n');
|
||||||
|
};
|
||||||
|
if (process.stdin.isTTY) {
|
||||||
|
// via args
|
||||||
|
jsonize(process.argv.slice(2));
|
||||||
|
} else {
|
||||||
|
// via pipe
|
||||||
|
var str = '';
|
||||||
|
process.stdin.on('readable', function() {
|
||||||
|
var read = process.stdin.read();
|
||||||
|
if (read !== null) {
|
||||||
|
str += read;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
process.stdin.on('end', function () {
|
||||||
|
jsonize(str.replace(/\n$/, '').split('\n'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
exports.UAParser = UAParser;
|
exports.UAParser = UAParser;
|
||||||
} else {
|
} else {
|
||||||
// requirejs env (optional)
|
// requirejs env (optional)
|
||||||
@ -913,7 +1090,7 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
return UAParser;
|
return UAParser;
|
||||||
});
|
});
|
||||||
} else {
|
} else if (window) {
|
||||||
// browser env
|
// browser env
|
||||||
window.UAParser = UAParser;
|
window.UAParser = UAParser;
|
||||||
}
|
}
|
||||||
@ -924,8 +1101,8 @@
|
|||||||
// In AMD env the global scope should be kept clean, but jQuery is an exception.
|
// In AMD env the global scope should be kept clean, but jQuery is an exception.
|
||||||
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
|
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
|
||||||
// and we should catch that.
|
// and we should catch that.
|
||||||
var $ = window.jQuery || window.Zepto;
|
var $ = window && (window.jQuery || window.Zepto);
|
||||||
if (typeof $ !== UNDEF_TYPE) {
|
if (typeof $ !== UNDEF_TYPE && !$.ua) {
|
||||||
var parser = new UAParser();
|
var parser = new UAParser();
|
||||||
$.ua = parser.getResult();
|
$.ua = parser.getResult();
|
||||||
$.ua.get = function () {
|
$.ua.get = function () {
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36",
|
"ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Android Browser",
|
"name" : "Samsung Browser",
|
||||||
"version" : "3.0",
|
"version" : "3.0",
|
||||||
"major" : "3"
|
"major" : "3"
|
||||||
}
|
}
|
||||||
@ -139,6 +139,26 @@
|
|||||||
"major" : "20"
|
"major" : "20"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Chrome Headless",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Chrome Headless",
|
||||||
|
"version" : "undefined",
|
||||||
|
"major" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Chrome Headless",
|
||||||
|
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/60.0.3112.113 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Chrome Headless",
|
||||||
|
"version" : "60.0.3112.113",
|
||||||
|
"major" : "60"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Chrome WebView",
|
"desc" : "Chrome WebView",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36",
|
"ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36",
|
||||||
@ -220,13 +240,63 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Facebook in-App Browser",
|
"desc" : "Waterfox",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Waterfox",
|
||||||
|
"version" : "55.2.2",
|
||||||
|
"major" : "55"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "PaleMoon",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/3.4 Firefox/52.9 PaleMoon/27.6.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "PaleMoon",
|
||||||
|
"version" : "27.6.1",
|
||||||
|
"major" : "27"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Basilisk",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Goanna/4.0 Firefox/55.0 Basilisk/20171113",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Basilisk",
|
||||||
|
"version" : "20171113",
|
||||||
|
"major" : "20171113"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Facebook in-App Browser for Android",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/35.0.0.48.273;]",
|
"ua" : "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/35.0.0.48.273;]",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Chrome WebView",
|
"name" : "Facebook",
|
||||||
"version" : "43.0.2357.121",
|
"version" : "35.0.0.48.273",
|
||||||
"major" : "43"
|
"major" : "35"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Facebook in-App Browser for iOS",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E304 [FBAN/FBIOS;FBAV/91.0.0.41.73;FBBV/57050710;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/10.3.1;FBSS/2;FBCR/Telekom.de;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0])",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Facebook",
|
||||||
|
"version" : "91.0.0.41.73",
|
||||||
|
"major" : "91"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Falkon",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/3.0.0 Chrome/61.0.3163.140 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Falkon",
|
||||||
|
"version" : "3.0.0",
|
||||||
|
"major" : "3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -259,6 +329,15 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc": "Firefox Focus",
|
||||||
|
"ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/6.1.1 Chrome/68.0.3440.91 Mobile Safari/537.36",
|
||||||
|
"expect": {
|
||||||
|
"name": "Firefox Focus",
|
||||||
|
"version": "6.1.1",
|
||||||
|
"major": "6"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Flock",
|
"desc" : "Flock",
|
||||||
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0",
|
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0",
|
||||||
@ -379,6 +458,36 @@
|
|||||||
"major" : "3"
|
"major" : "3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Konqueror",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) konqueror/5.0.97 Safari/534.34",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Konqueror",
|
||||||
|
"version" : "5.0.97",
|
||||||
|
"major" : "5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LINE on Android",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Line",
|
||||||
|
"version" : "6.5.1",
|
||||||
|
"major" : "6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LINE on iOS",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 Safari Line/8.4.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Line",
|
||||||
|
"version" : "8.4.1",
|
||||||
|
"major" : "8"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Lunascape",
|
"desc" : "Lunascape",
|
||||||
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090804 Firefox/3.5.2 Lunascape/5.1.4.5",
|
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090804 Firefox/3.5.2 Lunascape/5.1.4.5",
|
||||||
@ -529,6 +638,16 @@
|
|||||||
"major" : "7"
|
"major" : "7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Oculus Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Oculus Browser",
|
||||||
|
"version" : "3.4.9",
|
||||||
|
"major" : "3"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "OmniWeb",
|
"desc" : "OmniWeb",
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48",
|
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48",
|
||||||
@ -619,6 +738,26 @@
|
|||||||
"major" : "11"
|
"major" : "11"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Opera Coast",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X; en) AppleWebKit/601.1.46 (KHTML, like Gecko) Coast/5.04.110603 Mobile/13F69 Safari/7534.48.3",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Opera Coast",
|
||||||
|
"version" : "5.04.110603",
|
||||||
|
"major" : "5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Opera Touch",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 7.0; Lenovo P2a42 Build/NRD90N) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36 OPT/1.10.33",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Opera Touch",
|
||||||
|
"version" : "1.10.33",
|
||||||
|
"major" : "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "PhantomJS",
|
"desc" : "PhantomJS",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34",
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34",
|
||||||
@ -659,6 +798,16 @@
|
|||||||
"major" : "7"
|
"major" : "7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "QupZilla",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.9 Safari/538.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "QupZilla",
|
||||||
|
"version" : "1.8.9",
|
||||||
|
"major" : "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "RockMelt",
|
"desc" : "RockMelt",
|
||||||
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) RockMelt/0.8.36.78 Chrome/7.0.517.44 Safari/534.7",
|
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) RockMelt/0.8.36.78 Chrome/7.0.517.44 Safari/534.7",
|
||||||
@ -689,6 +838,16 @@
|
|||||||
"major" : "2"
|
"major" : "2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Samsung Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G925A Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Samsung Browser",
|
||||||
|
"version" : "4.0",
|
||||||
|
"major" : "4"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "SeaMonkey",
|
"desc" : "SeaMonkey",
|
||||||
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre",
|
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre",
|
||||||
@ -749,6 +908,26 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "UC Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 UBrowser/5.6.12860.7 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "UCBrowser",
|
||||||
|
"version" : "5.6.12860.7",
|
||||||
|
"major" : "5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "UC Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; U; Android 6.0.1; en-US; Lenovo P2a42 Build/MMB29M) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/11.2.0.915 U3/0.8.0 Mobile Safari/534.30",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "UCBrowser",
|
||||||
|
"version" : "11.2.0.915",
|
||||||
|
"major" : "11"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "UC Browser on Samsung",
|
"desc" : "UC Browser on Samsung",
|
||||||
"ua" : "Mozilla/5.0 (Java; U; Pt-br; samsung-gt-s5620) UCBrowser8.2.1.144/69/352/UCWEB Mobile UNTRUSTED/1.0",
|
"ua" : "Mozilla/5.0 (Java; U; Pt-br; samsung-gt-s5620) UCBrowser8.2.1.144/69/352/UCWEB Mobile UNTRUSTED/1.0",
|
||||||
@ -829,6 +1008,16 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Puffin",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Puffin",
|
||||||
|
"version" : "6.0.8.15804AP",
|
||||||
|
"major" : "6"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Microsoft Edge",
|
"desc" : "Microsoft Edge",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
|
||||||
@ -839,6 +1028,26 @@
|
|||||||
"major" : "12"
|
"major" : "12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Microsoft Edge on iOS",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 EdgiOS/42.1.1.0 Mobile/15F79 Safari/605.1.15",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Edge",
|
||||||
|
"version" : "42.1.1.0",
|
||||||
|
"major" : "42"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Microsoft Edge on Android",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 8.0.0; G8441 Build/47.1.A.12.270) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.123 Mobile Safari/537.36 EdgA/42.0.0.2529",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Edge",
|
||||||
|
"version" : "42.0.0.2529",
|
||||||
|
"major" : "42"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Iridium",
|
"desc" : "Iridium",
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/43.8 Safari/537.36 Chrome/43.0.2357.132",
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/43.8 Safari/537.36 Chrome/43.0.2357.132",
|
||||||
@ -888,5 +1097,71 @@
|
|||||||
"version" : "3.43.901.400",
|
"version" : "3.43.901.400",
|
||||||
"major" : "3"
|
"major" : "3"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "GSA on iOS",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "GSA",
|
||||||
|
"version" : "30.1.161623614",
|
||||||
|
"major" : "30"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Sogou Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "MetaSr"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LieBao Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.154 Safari/537.36 LBBROWSER",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "LBBROWSER"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "BaiDu Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 BIDUBrowser/8.7 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "BIDUBrowser",
|
||||||
|
"version" : "8.7",
|
||||||
|
"major" : "8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "2345 Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "2345Explorer",
|
||||||
|
"version" : "9.2.1.17116",
|
||||||
|
"major" : "9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "QQBrowserLite",
|
||||||
|
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14 QQBrowserLite/1.1.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "QQBrowserLite",
|
||||||
|
"version" : "1.1.0",
|
||||||
|
"major" : "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Brave Browser",
|
||||||
|
"ua" : "Brave/4.5.16 CFNetwork/893.13.1 Darwin/17.3.0 (x86_64)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Brave",
|
||||||
|
"version" : "4.5.16",
|
||||||
|
"major" : "4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -47,6 +47,14 @@
|
|||||||
"architecture" : "arm"
|
"architecture" : "arm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "ARMv7",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; CrOS armv7l 9765.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.123 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "arm"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Pocket PC",
|
"desc" : "Pocket PC",
|
||||||
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"desc" : "Blink",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Blink",
|
||||||
|
"version" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "EdgeHTML",
|
"desc" : "EdgeHTML",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0",
|
"ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0",
|
||||||
@ -17,6 +26,15 @@
|
|||||||
"version" : "2.0b9pre"
|
"version" : "2.0b9pre"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Goanna",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 5.1; rv:38.9) Gecko/20100101 Goanna/2.2 Firefox/38.9 PaleMoon/26.5.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Goanna",
|
||||||
|
"version" : "2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "KHTML",
|
"desc" : "KHTML",
|
||||||
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
|
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
|
||||||
@ -70,5 +88,14 @@
|
|||||||
"name" : "WebKit",
|
"name" : "WebKit",
|
||||||
"version" : "533.19.4"
|
"version" : "533.19.4"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "WebKit",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/27.0.1453.110 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "WebKit",
|
||||||
|
"version" : "537.36"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -433,11 +433,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Chromium OS",
|
"desc" : "Chromium OS",
|
||||||
"ua" : "",
|
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "",
|
"name" : "Chromium OS",
|
||||||
"version" : ""
|
"version" : "10575.58.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Fuchsia",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Fuchsia x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3557.0 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Fuchsia",
|
||||||
|
"version" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -485,6 +494,15 @@
|
|||||||
"version" : ""
|
"version" : ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iOS in App",
|
||||||
|
"ua" : "AppName/version CFNetwork/version Darwin/version",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "iOS",
|
||||||
|
"version" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "iOS with Chrome",
|
"desc" : "iOS with Chrome",
|
||||||
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
|
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
|
||||||
|
30
test/test.js
30
test/test.js
@ -65,13 +65,35 @@ for (var i in methods) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
describe('Returns', function () {
|
||||||
|
it('getResult() should returns JSON', function(done) {
|
||||||
|
assert.deepEqual(new UAParser('').getResult(),
|
||||||
|
{
|
||||||
|
ua : '',
|
||||||
|
browser: { name: undefined, version: undefined, major: undefined },
|
||||||
|
cpu: { architecture: undefined },
|
||||||
|
device: { vendor: undefined, model: undefined, type: undefined },
|
||||||
|
engine: { name: undefined, version: undefined},
|
||||||
|
os: { name: undefined, version: undefined }
|
||||||
|
});
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Extending Regex', function () {
|
describe('Extending Regex', function () {
|
||||||
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
|
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
|
||||||
var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];
|
var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];
|
||||||
var parser = new UAParser(uaString, {browser: myOwnBrowser});
|
|
||||||
assert.equal(parser.getBrowser().name, 'MyOwnBrowser');
|
var parser1 = new UAParser(uaString, {browser: myOwnBrowser});
|
||||||
assert.equal(parser.getBrowser().version, '1.3');
|
assert.equal(parser1.getBrowser().name, 'MyOwnBrowser');
|
||||||
assert.equal(parser.getBrowser().major, '1');
|
assert.equal(parser1.getBrowser().version, '1.3');
|
||||||
|
assert.equal(parser1.getBrowser().major, '1');
|
||||||
|
|
||||||
|
var parser2 = new UAParser({browser: myOwnBrowser});
|
||||||
|
assert.equal(parser2.getBrowser().name, undefined);
|
||||||
|
parser2.setUA(uaString);
|
||||||
|
assert.equal(parser2.getBrowser().name, 'MyOwnBrowser');
|
||||||
|
assert.equal(parser1.getBrowser().version, '1.3');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Using Require.js', function () {
|
describe('Using Require.js', function () {
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "UAParser.js",
|
|
||||||
"name": "ua-parser-js",
|
|
||||||
"version": "0.7.12",
|
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
|
||||||
"keywords": [
|
|
||||||
"user-agent",
|
|
||||||
"parser",
|
|
||||||
"browser",
|
|
||||||
"engine",
|
|
||||||
"os",
|
|
||||||
"device",
|
|
||||||
"cpu"
|
|
||||||
],
|
|
||||||
"homepage": "https://faisalman.github.com/ua-parser-js",
|
|
||||||
"author": {
|
|
||||||
"name": "Faisal Salman",
|
|
||||||
"email": "fyzlman@gmail.com"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"jquery": ">=1.5"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "http://www.opensource.org/licenses/mit-license.php"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
|
||||||
"docs": "https://github.com/faisalman/ua-parser-js",
|
|
||||||
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user