upload site

This commit is contained in:
ry 2020-01-03 21:48:09 +01:00
commit 69c5b90d6a
3300 changed files with 224783 additions and 0 deletions

28
node_modules/ua-parser-js/.npmignore generated vendored Normal file
View file

@ -0,0 +1,28 @@
node_modules/
npm-debug.log
### vim ###
.*.s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
.versions
### editors ###
.vscode
.idea
*.sublime-*
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes

13
node_modules/ua-parser-js/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,13 @@
language: node_js
node_js:
- stable
- lts/*
notifications:
email: false
cache:
directories:
- node_modules
sudo: false

17
node_modules/ua-parser-js/bower.json generated vendored Normal file
View file

@ -0,0 +1,17 @@
{
"name": "ua-parser-js",
"version": "0.7.20",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
"private": false,
"main": "src/ua-parser.js",
"ignore": [
"build",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {}
}

1
node_modules/ua-parser-js/dist/ua-parser.html generated vendored Normal file
View file

@ -0,0 +1 @@
<script src="./ua-parser.min.js"></script>

9
node_modules/ua-parser-js/dist/ua-parser.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

9
node_modules/ua-parser-js/dist/ua-parser.pack.js generated vendored Normal file

File diff suppressed because one or more lines are too long

21
node_modules/ua-parser-js/license.md generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2019 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.

12
node_modules/ua-parser-js/package.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '0.7.20',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
});
Package.onUse(function (api) {
api.addFiles("src/ua-parser.js");
api.export("UAParser");
});

408
node_modules/ua-parser-js/package.json generated vendored Normal file
View file

@ -0,0 +1,408 @@
{
"_args": [
[
"ua-parser-js@0.7.20",
"/home/ry/Desktop/Work/benji.monster"
]
],
"_from": "ua-parser-js@0.7.20",
"_id": "ua-parser-js@0.7.20",
"_inBundle": false,
"_integrity": "sha512-8OaIKfzL5cpx8eCMAhhvTlft8GYF8b2eQr6JkCyVdrgjcytyOmPCXrqXFcUnhonRpLlh5yxEZVohm6mzaowUOw==",
"_location": "/ua-parser-js",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ua-parser-js@0.7.20",
"name": "ua-parser-js",
"escapedName": "ua-parser-js",
"rawSpec": "0.7.20",
"saveSpec": null,
"fetchSpec": "0.7.20"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.20.tgz",
"_spec": "0.7.20",
"_where": "/home/ry/Desktop/Work/benji.monster",
"author": {
"name": "Faisal Salman",
"email": "f@faisalman.com",
"url": "http://faisalman.com"
},
"bugs": {
"url": "https://github.com/faisalman/ua-parser-js/issues"
},
"contributors": [
{
"name": "Aamir Poonawalla",
"email": "aamir@urx.com"
},
{
"name": "Admas",
"email": "mollases@users.noreply.github.com"
},
{
"name": "algenon",
"email": "m@antonz.ru"
},
{
"name": "Alvin Portillo",
"email": "portilloalvin@gmail.com"
},
{
"name": "Andrea Vaghi",
"email": "andrea.vaghi@jobrapido.com"
},
{
"name": "Anton Zhiyanov",
"email": "m@antonz.ru"
},
{
"name": "Arturo Mejia",
"email": "amejia@blim.com"
},
{
"name": "Arun Rama Reddy",
"email": "arunramareddy@gmail.com"
},
{
"name": "Austin Pray",
"email": "austin@austinpray.com"
},
{
"name": "Benjamin Bertrand",
"email": "bertrand.design@gmail.com"
},
{
"name": "Benjamin Urban",
"email": "benjamin.urban@sueddeutsche.de"
},
{
"name": "boneyao",
"email": "admin@boneyao.com"
},
{
"name": "Carl C Von Lewin",
"email": "carlchristianlewin@gmail.com"
},
{
"name": "CESAR RAMOS",
"email": "c@imagenproactiva.com"
},
{
"name": "Christopher De Cairos",
"email": "chris.decairos@gmail.com"
},
{
"name": "Dario Vladovic",
"email": "d.vladimyr@gmail.com"
},
{
"name": "Davit Barbakadze",
"email": "jayarjo@gmail.com"
},
{
"name": "ddivernois",
"email": "david-emmanuel.divernois@amadeus.com"
},
{
"name": "Demis Palma",
"email": "demis.palma@gmail.com"
},
{
"name": "dhoko",
"email": "aurelien@protonmail.com"
},
{
"name": "dianhe",
"email": "dianhe@webank.com"
},
{
"name": "Dmitry Tyschenko",
"email": "dtyschenko@gmail.com"
},
{
"name": "Douglas Li",
"email": "doug@knotch.it"
},
{
"name": "Dumitru Uzun",
"email": "contact@duzun.me"
},
{
"name": "Eric Schrenker",
"email": "eric.schrenker@gmail.com"
},
{
"name": "Erik Hesselink",
"email": "hesselink@gmail.com"
},
{
"name": "Fabian Becker",
"email": "halfdan@xnorfz.de"
},
{
"name": "Faisal Salman",
"email": "fyzlman@gmail.com"
},
{
"name": "Frédéric Camblor",
"email": "fcamblor@gmail.com"
},
{
"name": "Germán M. Bravo",
"email": "german.mb@gmail.com"
},
{
"name": "Grigory Dmitrenko",
"email": "grigory@snsk.ru"
},
{
"name": "Hendrik Helwich",
"email": "h.helwich@iplabs.de"
},
{
"name": "Hermann Ebert",
"email": "ebbmo@HE.local"
},
{
"name": "jackpoll",
"email": "jackpoll123456@gmail.com"
},
{
"name": "Jake Mc",
"email": "startswithaj@users.noreply.github.com"
},
{
"name": "John Tantalo",
"email": "john.tantalo@gmail.com"
},
{
"name": "John Yanarella",
"email": "jmy@codecatalyst.com"
},
{
"name": "Jon Buckley",
"email": "jon@jbuckley.ca"
},
{
"name": "Kendall Buchanan",
"email": "kendall@kendagriff.com"
},
{
"name": "Lee Treveil",
"email": "leetreveil@gmail.com"
},
{
"name": "leonardo",
"email": "leofiore@libero.it"
},
{
"name": "Levente Balogh",
"email": "balogh.levente.hu@gmail.com"
},
{
"name": "Liam Quinn",
"email": "lquinn@blackberry.com"
},
{
"name": "Lithin",
"email": "lithin@webklipper.com"
},
{
"name": "Loris Guignard",
"email": "loris.guignard@gmail.com"
},
{
"name": "Lukas Drgon",
"email": "lukas.drgon@gmail.com"
},
{
"name": "Lukas Eipert",
"email": "leipert@users.noreply.github.com"
},
{
"name": "Malash",
"email": "i@malash.me"
},
{
"name": "Martynas",
"email": "martynas@firmfirm.co"
},
{
"name": "Matt Brophy",
"email": "matt@brophy.org"
},
{
"name": "Max Maurer",
"email": "maxemanuel.maurer@gmail.com"
},
{
"name": "Maximilian Haupt",
"email": "mail@maximilianhaupt.com"
},
{
"name": "Michael Hess",
"email": "mhess@connectify.me"
},
{
"name": "naoh",
"email": "naoh.cs03g@nctu.edu.tw"
},
{
"name": "Nik Rolls",
"email": "nik@rolls.cc"
},
{
"name": "Nikhil Motiani",
"email": "nikhil.m@247-inc.com"
},
{
"name": "niris",
"email": "nirisix@gmail.com"
},
{
"name": "Nobuo Okada",
"email": "nookada@yahoo-corp.jp"
},
{
"name": "otakuSiD",
"email": "otakusid@gmail.com"
},
{
"name": "Peter Dave Hello",
"email": "PeterDaveHello@users.noreply.github.com"
},
{
"name": "philippsimon",
"email": "github@philippsimon.de"
},
{
"name": "Pieter Hendrickx",
"email": "pieter.hendrickx@belfius.be"
},
{
"name": "Piper Chester",
"email": "piperchester@gmail.com"
},
{
"name": "Robert Tod",
"email": "robert@qubit.com"
},
{
"name": "Ron Korland",
"email": "ron@testim.io"
},
{
"name": "Ross Noble",
"email": "rosshnoble@gmail.com"
},
{
"name": "Sandro Sonntag",
"email": "sandro.sonntag@adorsys.de"
},
{
"name": "sgautrea",
"email": "shanegautreau@gmail.com"
},
{
"name": "Shane Gautreau",
"email": "sgautrea@opentext.com"
},
{
"name": "Shane Thacker",
"email": "shane@steadymade.com"
},
{
"name": "shchotse",
"email": "topal@mail.ua"
},
{
"name": "Simon Eisenmann",
"email": "simon@longsleep.org"
},
{
"name": "Simon Lang",
"email": "me@simonlang.org"
},
{
"name": "Stiekel",
"email": "histkc@gmail.com"
},
{
"name": "Sylvain Gizard",
"email": "sylvain.gizard@gmail.com"
},
{
"name": "szchenghuang",
"email": "szchenghuang@gmail.com"
},
{
"name": "Vadim Kurachevsky",
"email": "vadim@hmvs.org"
},
{
"name": "Yun Young-jin",
"email": "yupmin@yupmin-office-macmini.local"
}
],
"demo": "https://faisalman.github.io/ua-parser-js",
"description": "Lightweight JavaScript-based user-agent string parser",
"devDependencies": {
"jshint": "~1.1.0",
"mocha": "~1.8.0",
"requirejs": "^2.3.2",
"uglify-js": "~2.7.5",
"verup": "^1.3.x"
},
"directories": {
"dist": "dist",
"src": "src",
"test": "test"
},
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js",
"engines": {
"node": "*"
},
"homepage": "http://github.com/faisalman/ua-parser-js",
"keywords": [
"user-agent",
"parser",
"browser",
"engine",
"os",
"device",
"cpu",
"jquery-plugin",
"ecosystem:jquery"
],
"license": "MIT",
"main": "src/ua-parser.js",
"name": "ua-parser-js",
"repository": {
"type": "git",
"url": "git+https://github.com/faisalman/ua-parser-js.git"
},
"scripts": {
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/UAParser\\.js/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
"version": "node ./node_modules/verup 0",
"verup": "node ./node_modules/verup"
},
"title": "UAParser.js",
"version": "0.7.20",
"verup": {
"files": [
"bower.json",
"package.js",
"src/ua-parser.js"
],
"regs": [
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
"^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
]
}
}

336
node_modules/ua-parser-js/readme.md generated vendored Normal file
View file

@ -0,0 +1,336 @@
# 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 (~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.
[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master)](https://travis-ci.org/faisalman/ua-parser-js)
[![NPM downloads](https://img.shields.io/npm/dw/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js)
[![NPM](https://img.shields.io/npm/v/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js)
[![Bower](https://img.shields.io/bower/v/ua-parser-js.svg)](https://bower.io/)
[![CDNJS](https://img.shields.io/cdnjs/v/UAParser.js.svg)](https://cdnjs.com/libraries/UAParser.js)
* Author : Faisal Salman <<f@faisalman.com>>
* Demo : http://faisalman.github.io/ua-parser-js
* Source : https://github.com/faisalman/ua-parser-js
# Constructor
* `new UAParser([uastring][,extensions])`
* returns new instance
* `UAParser([uastring][,extensions])`
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
# Methods
* `getBrowser()`
* returns `{ name: '', version: '' }`
```sh
# Possible 'browser.name':
2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu,
Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless,
Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Dolphin, Doris, Edge,
Epiphany, Facebook, Falkon, Fennec, Firebird, Firefox, Flock, GSA, GoBrowser,
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceape, Iceweasel,
Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror, LBBROWSER Line, Links,
Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon, MetaSr Midori,
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
```
* `getDevice()`
* returns `{ model: '', type: '', vendor: '' }`
```sh
# Possible 'device.type':
console, mobile, tablet, smarttv, wearable, embedded
# Possible 'device.vendor':
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, Essential,
GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola,
Nexian, Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron,
RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ...
# 'device.model' determined dynamically
```
* `getEngine()`
* returns `{ name: '', version: '' }`
```sh
# Possible 'engine.name'
Amaya, Blink, EdgeHTML, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, NetSurf,
Presto, Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically
```
* `getOS()`
* returns `{ name: '', version: '' }`
```sh
# Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU, Haiku, Hurd, iOS,
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,
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
# 'os.version' determined dynamically
```
* `getCPU()`
* returns `{ architecture: '' }`
```sh
# Possible 'cpu.architecture'
68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
```
* `getResult()`
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
* `getUA()`
* returns UA string of current instance
* `setUA(uastring)`
* set UA string to parse
* returns current instance
# Example
```html
<!doctype html>
<html>
<head>
<script type="text/javascript" src="ua-parser.min.js"></script>
<script type="text/javascript">
var parser = new UAParser();
// by default it takes ua string from current browser's window.navigator.userAgent
console.log(parser.getResult());
/*
/// this will print an object structured like this:
{
ua: "",
browser: {
name: "",
version: ""
},
engine: {
name: "",
version: ""
},
os: {
name: "",
version: ""
},
device: {
model: "",
type: "",
vendor: ""
},
cpu: {
architecture: ""
}
}
*/
// let's test a custom user-agent string as an example
var uastring = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 Chrome/15.0.874.106 Safari/535.2";
parser.setUA(uastring);
var result = parser.getResult();
// this will also produce the same result (without instantiation):
// var result = UAParser(uastring);
console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"}
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
console.log(result.os.version); // "11.10"
console.log(result.engine.name); // "WebKit"
console.log(result.cpu.architecture); // "amd64"
// do some other tests
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)";
console.log(parser.setUA(uastring2).getBrowser().name); // "Konqueror"
console.log(parser.getOS()); // {name: "OpenBSD", version: undefined}
console.log(parser.getEngine()); // {name: "KHTML", version: "4.1.4"}
var uastring3 = 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Version/7.1.0.7 Safari/534.11';
console.log(parser.setUA(uastring3).getDevice().model); // "PlayBook"
console.log(parser.getOS()) // {name: "RIM Tablet OS", version: "1.0.0"}
console.log(parser.getBrowser().name); // "Safari"
</script>
</head>
<body>
</body>
</html>
```
## Using node.js
```sh
$ npm install ua-parser-js
```
```js
var http = require('http');
var parser = require('ua-parser-js');
http.createServer(function (req, res) {
// get user-agent header
var ua = parser(req.headers['user-agent']);
// write the result as response
res.end(JSON.stringify(ua, null, ' '));
})
.listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
```
## Using requirejs
```js
requirejs.config({
baseUrl : 'js/lib', // path to your script directory
paths : {
'ua-parser-js' : 'ua-parser.min'
}
});
requirejs(['ua-parser-js'], function(UAParser) {
var parser = new UAParser();
console.log(parser.getResult());
});
```
## Using CDN
```html
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@0/dist/ua-parser.min.js"></script>
```
## Using bower
```sh
$ bower install ua-parser-js
```
## Using meteor
```sh
$ 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 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)`.
```js
// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
// Do some tests
console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"}
console.log($.ua.os); // {name: "Android", version: "2.3.4"}
console.log($.ua.os.name); // "Android"
console.log($.ua.get()); // "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0"
// reset to custom user-agent
$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13');
// Test again
console.log($.ua.browser.name); // "Safari"
console.log($.ua.engine.name); // "Webkit"
console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"}
console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4
// Add class to <body> tag
// <body class="ua-browser-safari ua-devicetype-tablet">
$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type);
```
## Extending regex patterns
* `UAParser([uastring,] extensions)`
Pass your own regexes to extend the limited matching rules.
```js
// Example:
var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
var myParser = new UAParser({ browser: myOwnRegex });
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
console.log(myParser.setUA(uaString).getBrowser()); // {name: "MyOwnBrowser", version: "1.3"}
```
# Development
## Contribute
* Fork and clone this repository
* Make some changes as required
* Write a unit test to showcase your feature
* Run the test suites to make sure the changes you made didn't break anything `$ npm run test`
* Commit and push to your own repository
* Submit a pull request to this repository under `develop` branch
* Profit? $$$
## Build
Build a minified & packed script
```sh
$ npm run build
```
# Donate
Do you use & like UAParser.js but you dont 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 :)
[![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/faisalman/)
# License
MIT License
Copyright (c) 2012-2019 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.

896
node_modules/ua-parser-js/src/ua-parser.js generated vendored Executable file
View file

@ -0,0 +1,896 @@
/*!
* UAParser.js v0.7.20
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
* Licensed under MIT License
*/
(function (window, undefined) {
'use strict';
//////////////
// Constants
/////////////
var LIBVERSION = '0.7.20',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
UNDEF_TYPE = 'undefined',
OBJ_TYPE = 'object',
STR_TYPE = 'string',
MAJOR = 'major', // deprecated
MODEL = 'model',
NAME = 'name',
TYPE = 'type',
VENDOR = 'vendor',
VERSION = 'version',
ARCHITECTURE= 'architecture',
CONSOLE = 'console',
MOBILE = 'mobile',
TABLET = 'tablet',
SMARTTV = 'smarttv',
WEARABLE = 'wearable',
EMBEDDED = 'embedded';
///////////
// Helper
//////////
var util = {
extend : function (regexes, extensions) {
var mergedRegexes = {};
for (var i in regexes) {
if (extensions[i] && extensions[i].length % 2 === 0) {
mergedRegexes[i] = extensions[i].concat(regexes[i]);
} else {
mergedRegexes[i] = regexes[i];
}
}
return mergedRegexes;
},
has : function (str1, str2) {
if (typeof str1 === "string") {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
} else {
return false;
}
},
lowerize : function (str) {
return str.toLowerCase();
},
major : function (version) {
return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g,'').split(".")[0] : undefined;
},
trim : function (str) {
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
}
};
///////////////
// Map helper
//////////////
var mapper = {
rgx : function (ua, arrays) {
var i = 0, j, k, p, q, matches, match;
// loop through all regexes maps
while (i < arrays.length && !matches) {
var regex = arrays[i], // even sequence (0,2,4,..)
props = arrays[i + 1]; // odd sequence (1,3,5,..)
j = k = 0;
// try matching uastring with regexes
while (j < regex.length && !matches) {
matches = regex[j++].exec(ua);
if (!!matches) {
for (p = 0; p < props.length; p++) {
match = matches[++k];
q = props[p];
// check if given property is actually array
if (typeof q === OBJ_TYPE && q.length > 0) {
if (q.length == 2) {
if (typeof q[1] == FUNC_TYPE) {
// assign modified match
this[q[0]] = q[1].call(this, match);
} else {
// assign given value, ignore regex match
this[q[0]] = q[1];
}
} else if (q.length == 3) {
// check whether function or regex
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
// call function (usually string mapper)
this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
} else {
// sanitize match using given regex
this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
}
} else if (q.length == 4) {
this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
}
} else {
this[q] = match ? match : undefined;
}
}
}
}
i += 2;
}
},
str : function (str, map) {
for (var i in map) {
// check if array
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) {
if (util.has(map[i][j], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
} else if (util.has(map[i], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
return str;
}
};
///////////////
// String map
//////////////
var maps = {
browser : {
oldsafari : {
version : {
'1.0' : '/8',
'1.2' : '/1',
'1.3' : '/3',
'2.0' : '/412',
'2.0.2' : '/416',
'2.0.3' : '/417',
'2.0.4' : '/419',
'?' : '/'
}
}
},
device : {
amazon : {
model : {
'Fire Phone' : ['SD', 'KF']
}
},
sprint : {
model : {
'Evo Shift 4G' : '7373KT'
},
vendor : {
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
version : {
'ME' : '4.90',
'NT 3.11' : 'NT3.51',
'NT 4.0' : 'NT4.0',
'2000' : 'NT 5.0',
'XP' : ['NT 5.1', 'NT 5.2'],
'Vista' : 'NT 6.0',
'7' : 'NT 6.1',
'8' : 'NT 6.2',
'8.1' : 'NT 6.3',
'10' : ['NT 6.4', 'NT 10.0'],
'RT' : 'ARM'
}
}
}
};
//////////////
// Regex map
/////////////
var regexes = {
browser : [[
// Presto based
/(opera\smini)\/([\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/([\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80
], [NAME, VERSION], [
/(opios)[\/\s]+([\w\.]+)/i // Opera mini on iphone >= 8.0
], [[NAME, 'Opera Mini'], VERSION], [
/\s(opr)\/([\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION], [
// Mixed
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)\/([\w\.]*)/i, // Rekonq
/(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/QupZilla/Falkon
], [NAME, VERSION], [
/(konqueror)\/([\w\.]+)/i // Konqueror
], [[NAME, 'Konqueror'], VERSION], [
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
], [[NAME, 'IE'], VERSION], [
/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i // Microsoft Edge
], [[NAME, 'Edge'], VERSION], [
/(yabrowser)\/([\w\.]+)/i // Yandex
], [[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
], [[NAME, /_/g, ' '], VERSION], [
/(windowswechat qbcore)\/([\w\.]+)/i // WeChat Desktop for Windows Built-in Browser
], [[NAME, 'WeChat(Win) Desktop'], VERSION], [
/(micromessenger)\/([\w\.]+)/i // WeChat
], [[NAME, 'WeChat'], VERSION], [
/(brave)\/([\w\.]+)/i // Brave browser
], [[NAME, 'Brave'], VERSION], [
/(qqbrowserlite)\/([\w\.]+)/i // QQBrowserLite
], [NAME, VERSION], [
/(QQ)\/([\d\.]+)/i // QQ, aka ShouQ
], [NAME, VERSION], [
/m?(qqbrowser)[\/\s]?([\w\.]+)/i // QQBrowser
], [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
], [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
], [[NAME, /(.+)/, '$1 WebView'], VERSION], [
/((?: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
], [VERSION, [NAME, 'Android Browser']], [
/(sailfishbrowser)\/([\w\.]+)/i // Sailfish Browser
], [[NAME, 'Sailfish Browser'], VERSION], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i
// Chrome/OmniWeb/Arora/Tizen/Nokia
], [NAME, VERSION], [
/(dolfin)\/([\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION], [
/((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION], [
/(coast)\/([\w\.]+)/i // Opera Coast
], [[NAME, 'Opera Coast'], VERSION], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, 'Firefox']], [
/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, [NAME, 'Mobile Safari']], [
/version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [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
], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [
/(webkit|khtml)\/([\w\.]+)/i
], [NAME, VERSION], [
// Gecko based
/(navigator|netscape)\/([\w\.-]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
/(links)\s\(([\w\.]+)/i, // Links
/(gobrowser)\/?([\w\.]*)/i, // GoBrowser
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]([\w\.]+)/i // Mosaic
], [NAME, VERSION]
],
cpu : [[
/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64
], [[ARCHITECTURE, 'amd64']], [
/(ia32(?=;))/i // IA32 (quicktime)
], [[ARCHITECTURE, util.lowerize]], [
/((?:i[346]|x)86)[;\)]/i // IA32
], [[ARCHITECTURE, 'ia32']], [
// PocketPC mistakenly identified as PowerPC
/windows\s(ce|mobile);\sppc;/i
], [[ARCHITECTURE, 'arm']], [
/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC
], [[ARCHITECTURE, /ower/, '', util.lowerize]], [
/(sun4\w)[;\)]/i // SPARC
], [[ARCHITECTURE, 'sparc']], [
/((?: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
], [[ARCHITECTURE, util.lowerize]]
],
device : [[
/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i // iPad/PlayBook
], [MODEL, VENDOR, [TYPE, TABLET]], [
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [
/(apple\s{0,1}tv)/i // Apple TV
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
/(archos)\s(gamepad2?)/i, // Archos
/(hp).+(touchpad)/i, // HP TouchPad
/(hp).+(tablet)/i, // HP Tablet
/(kindle)\/([\w\.]+)/i, // Kindle
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(kf[A-z]+)\sbuild\/.+silk\//i // Kindle Fire HD
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i // Fire Phone
], [[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
], [MODEL, VENDOR, [TYPE, MOBILE]], [
/\((ip[honed|\s\w*]+);/i // iPod/iPhone
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i // Asus
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/\(bb10;\s(\w+)/i // BlackBerry 10
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
// Asus Tablets
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
/(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
/(sony)?(?:sgp.+)\sbuild\//i
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [
/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i
], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [
/\s(ouya)\s/i, // Ouya
/(nintendo)\s([wids3u]+)/i // Nintendo
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
/android.+;\s(shield)\sbuild/i // Nvidia
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [
/(playstation\s[34portablevi]+)/i // Playstation
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [
/(sprint\s(\w+))/i // Sprint Phones
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC
/(zte)-(\w*)/i, // ZTE
/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
/(nexus\s9)/i // HTC Nexus 9
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
/d\/huawei([\w\s-]+)[;\)]/i,
/(nexus\s6p)/i // Huawei
], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [
/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [
/(kin\.[onetw]{3})/i // Microsoft Kin
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
// Motorola
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,
/mot[\s-]?(\w*)/i,
/(XT\d{3,4}) build\//i,
/(nexus\s6)/i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices
], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [
/hbbtv.+maple;(\d+)/i
], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [
/\(dtv[\);].+(aquos)/i // Sharp
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,
/((SM-T\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung
/smart-tv.+(samsung)/i
], [VENDOR, [TYPE, SMARTTV], MODEL], [
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,
/sec-((sgh\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
/sie-(\w*)/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
/(nokia)[\s_-]?([\w-]*)/i
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i // Acer
], [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
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
/(lg) netcast\.tv/i // LG SmartTV
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
/(nexus\s[45])/i, // LG
/lg[e;\s\/-]+(\w*)/i,
/android.+lg(\-?[\d\w]+)\s+build/i
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i // Lenovo tablets
], [VENDOR, MODEL, [TYPE, TABLET]], [
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
/(lenovo)[_\s-]?([\w-]+)/i
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/linux;.+((jolla));/i // Jolla
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/((pebble))app\/[\d\.]+\s/i // Pebble
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/crkey/i // Google Chromecast
], [[MODEL, 'Chromecast'], [VENDOR, 'Google']], [
/android.+;\s(glass)\s\d/i // Google Glass
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
/android.+;\s(pixel c)[\s)]/i // Google Pixel C
], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [
/android.+;\s(pixel( [23])?( xl)?)[\s)]/i // Google Pixel
], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [
/android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
/android.+(mi[\s\-_]*(?:a\d|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]], [
/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
], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [
/(mz)-([\w-]{2,})/i
], [[VENDOR, 'Meizu'], MODEL, [TYPE, MOBILE]], [
/android.+a000(1)\s+build/i, // OnePlus
/android.+oneplus\s(a\d{4})\s+build/i
], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [
/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
], [[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']]
],
engine : [[
/windows.+\sedge\/([\w\.]+)/i // EdgeHTML
], [VERSION, [NAME, 'EdgeHTML']], [
/webkit\/537\.36.+chrome\/(?!27)/i // Blink
], [[NAME, 'Blink']], [
/(presto)\/([\w\.]+)/i, // Presto
/(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
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [
/rv\:([\w\.]{1,9}).+(gecko)/i // Gecko
], [VERSION, NAME]
],
os : [[
// Windows based
/microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes)
], [NAME, VERSION], [
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone
/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
// Mobile/Embedded OS
/\((bb)(10);/i // BlackBerry 10
], [[NAME, 'BlackBerry'], VERSION], [
/(blackberry)\w*\/?([\w\.]*)/i, // Blackberry
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS
], [NAME, VERSION], [
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i // Symbian
], [[NAME, 'Symbian'], VERSION], [
/\((series40);/i // Series 40
], [NAME], [
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [
// Console
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w*)/i, // Mint
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
/(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
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
/(hurd|linux)\s?([\w\.]*)/i, // Hurd/Linux
/(gnu)\s?([\w\.]*)/i // GNU
], [NAME, VERSION], [
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[
// Solaris
/(sunos)\s?([\w\.\d]*)/i // Solaris
], [[NAME, 'Solaris'], VERSION], [
// BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [NAME, VERSION],[
/(haiku)\s(\w+)/i // Haiku
], [NAME, VERSION],[
/cfnetwork\/.+darwin/i,
/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i // iOS
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
/(mac\sos\sx)\s?([\w\s\.]*)/i,
/(macintosh|mac(?=_powerpc)\s)/i // Mac OS
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
// Other
/((?:open)?solaris)[\/\s-]?([\w\.]*)/i, // Solaris
/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, // AIX
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS/Fuchsia
/(unix)\s?([\w\.]*)/i // UNIX
], [NAME, VERSION]
]
};
/////////////////
// Constructor
////////////////
var UAParser = function (uastring, extensions) {
if (typeof uastring === 'object') {
extensions = uastring;
uastring = undefined;
}
if (!(this instanceof UAParser)) {
return new UAParser(uastring, extensions).getResult();
}
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
this.getBrowser = function () {
var browser = { name: undefined, version: undefined };
mapper.rgx.call(browser, ua, rgxmap.browser);
browser.major = util.major(browser.version); // deprecated
return browser;
};
this.getCPU = function () {
var cpu = { architecture: undefined };
mapper.rgx.call(cpu, ua, rgxmap.cpu);
return cpu;
};
this.getDevice = function () {
var device = { vendor: undefined, model: undefined, type: undefined };
mapper.rgx.call(device, ua, rgxmap.device);
return device;
};
this.getEngine = function () {
var engine = { name: undefined, version: undefined };
mapper.rgx.call(engine, ua, rgxmap.engine);
return engine;
};
this.getOS = function () {
var os = { name: undefined, version: undefined };
mapper.rgx.call(os, ua, rgxmap.os);
return os;
};
this.getResult = function () {
return {
ua : this.getUA(),
browser : this.getBrowser(),
engine : this.getEngine(),
os : this.getOS(),
device : this.getDevice(),
cpu : this.getCPU()
};
};
this.getUA = function () {
return ua;
};
this.setUA = function (uastring) {
ua = uastring;
return this;
};
return this;
};
UAParser.VERSION = LIBVERSION;
UAParser.BROWSER = {
NAME : NAME,
MAJOR : MAJOR, // deprecated
VERSION : VERSION
};
UAParser.CPU = {
ARCHITECTURE : ARCHITECTURE
};
UAParser.DEVICE = {
MODEL : MODEL,
VENDOR : VENDOR,
TYPE : TYPE,
CONSOLE : CONSOLE,
MOBILE : MOBILE,
SMARTTV : SMARTTV,
TABLET : TABLET,
WEARABLE: WEARABLE,
EMBEDDED: EMBEDDED
};
UAParser.ENGINE = {
NAME : NAME,
VERSION : VERSION
};
UAParser.OS = {
NAME : NAME,
VERSION : VERSION
};
///////////
// Export
//////////
// check js environment
if (typeof(exports) !== UNDEF_TYPE) {
// nodejs env
if (typeof module !== UNDEF_TYPE && module.exports) {
exports = module.exports = UAParser;
}
exports.UAParser = UAParser;
} else {
// requirejs env (optional)
if (typeof(define) === 'function' && define.amd) {
define(function () {
return UAParser;
});
} else if (window) {
// browser env
window.UAParser = UAParser;
}
}
// jQuery/Zepto specific (optional)
// Note:
// 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,
// and we should catch that.
var $ = window && (window.jQuery || window.Zepto);
if (typeof $ !== UNDEF_TYPE && !$.ua) {
var parser = new UAParser();
$.ua = parser.getResult();
$.ua.get = function () {
return parser.getUA();
};
$.ua.set = function (uastring) {
parser.setUA(uastring);
var result = parser.getResult();
for (var prop in result) {
$.ua[prop] = result[prop];
}
};
}
})(typeof window === 'object' ? window : this);

1187
node_modules/ua-parser-js/test/browser-test.json generated vendored Normal file

File diff suppressed because it is too large Load diff

114
node_modules/ua-parser-js/test/cpu-test.json generated vendored Normal file
View file

@ -0,0 +1,114 @@
[
{
"desc" : "i686",
"ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "i386",
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "x86-64",
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "win64",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "WOW64",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "ARMv6",
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
"expect" :
{
"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",
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "UltraSPARC",
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
"expect" :
{
"architecture" : "sparc"
}
},
{
"desc" : "QuickTime",
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "XBMC",
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
"expect" :
{
"architecture" : "amd64"
}
}
]

1045
node_modules/ua-parser-js/test/device-test.json generated vendored Normal file

File diff suppressed because it is too large Load diff

101
node_modules/ua-parser-js/test/engine-test.json generated vendored Normal file
View file

@ -0,0 +1,101 @@
[
{
"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",
"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",
"expect" :
{
"name" : "EdgeHTML",
"version" : "12.0"
}
},
{
"desc" : "Gecko",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
"expect" :
{
"name" : "Gecko",
"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",
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
"expect" :
{
"name" : "KHTML",
"version" : "4.5.4"
}
},
{
"desc" : "NetFront",
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
"expect" :
{
"name" : "NetFront",
"version" : "3.0"
}
},
{
"desc" : "Presto",
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
"expect" :
{
"name" : "Presto",
"version" : "2.8.149"
}
},
{
"desc" : "Tasman",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)",
"expect" :
{
"name" : "Tasman",
"version" : "1.0"
}
},
{
"desc" : "Trident",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)",
"expect" :
{
"name" : "Trident",
"version" : "6.0"
}
},
{
"desc" : "WebKit",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
"expect" :
{
"name" : "WebKit",
"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"
}
}
]

582
node_modules/ua-parser-js/test/mediaplayer-test.json generated vendored Normal file
View file

@ -0,0 +1,582 @@
[
{
"desc" : "Coremedia",
"ua" : "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108",
"expect" :
{
"name" : "CoreMedia",
"version" : "1.0.0.10F2108",
"major" : "1"
}
},
{
"desc" : "AppleCoreMedia",
"ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)",
"expect" :
{
"name" : "AppleCoreMedia",
"version" : "1.0.0.10A403",
"major" : "1"
}
},
{
"desc" : "AppleTv",
"ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18",
"expect" :
{
"name" : "WebKit",
"version" : "528.18",
"major" : "528"
}
},
{
"desc" : "Aqualung",
"ua" : "Aqualung/R-1114",
"expect" :
{
"name" : "Aqualung",
"version" : "R-1114",
"major" : "undefined"
}
},
{
"desc" : "Ares",
"ua" : "Ares 2.2.4.3048",
"expect" :
{
"name" : "Ares",
"version" : "2.2.4.3048",
"major" : "2"
}
},
{
"desc" : "Audacious",
"ua" : "Audacious/3.2.2 neon/0.29.3",
"expect" :
{
"name" : "Audacious",
"version" : "3.2.2",
"major" : "3"
}
},
{
"desc" : "AudiMusicStream",
"ua" : "AudiMusicStream/3020.130826151911",
"expect" :
{
"name" : "AudiMusicStream",
"version" : "3020.130826151911",
"major" : "3020"
}
},
{
"desc" : "BASS",
"ua" : "BASS/2.4",
"expect" :
{
"name" : "BASS",
"version" : "2.4",
"major" : "2"
}
},
{
"desc" : "BSPlayer",
"ua" : "BSPlayer/2",
"expect" :
{
"name" : "BSPlayer",
"version" : "2",
"major" : "2"
}
},
{
"desc" : "Core",
"ua" : "CORE/6.506.4.1",
"expect" :
{
"name" : "CORE",
"version" : "6.506.4.1",
"major" : "6"
}
},
{
"desc" : "Clementine",
"ua" : "Clementine 1.1",
"expect" :
{
"name" : "Clementine",
"version" : "1.1",
"major" : "1"
}
},
{
"desc" : "Dalvik",
"ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)",
"expect" :
{
"name" : "Dalvik",
"version" : "1.2.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "E97510d/ Player/NexPlayer 4.0",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "FLRP",
"ua" : "FLRP/2.5 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "Flip Player",
"version" : "2.5",
"major" : "2"
}
},
{
"desc" : "FStream",
"ua" : "FStream",
"expect" :
{
"name" : "FStream",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "GStreamer",
"ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2",
"expect" :
{
"name" : "GStreamer",
"version" : "2.34.2",
"major" : "2"
}
},
{
"desc" : "GnomeMplayer",
"ua" : "GnomeMplayer/1.0.2",
"expect" :
{
"name" : "GnomeMplayer",
"version" : "1.0.2",
"major" : "1"
}
},
{
"desc" : "HTC Streaming Player",
"ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1",
"expect" :
{
"name" : "HTC Streaming Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "HTC One S",
"ua" : "HTC_One_S/3.16.111.10",
"expect" :
{
"name" : "HTC One S",
"version" : "3.16.111.10",
"major" : "3"
}
},
{
"desc" : "Java",
"ua" : "Java/1.4.1_04",
"expect" :
{
"name" : "Java",
"version" : "1.4.1_04",
"major" : "1"
}
},
{
"desc" : "LG Player",
"ua" : "LG Player 1.0; Android",
"expect" :
{
"name" : "LG Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "LG Player",
"ua" : "LGE400/V10b Player/LG Player 1.0",
"expect" :
{
"name" : "LG Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Lavf",
"ua" : "Lavf52.111.0",
"expect" :
{
"name" : "Lavf",
"version" : "52.111.0",
"major" : "52"
}
},
{
"desc" : "Lyssna",
"ua" : "Lyssna/46 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "Lyssna",
"version" : "46",
"major" : "46"
}
},
{
"desc" : "MPlayer",
"ua" : "MPlayer 1.1-4.2.1",
"expect" :
{
"name" : "MPlayer",
"version" : "1.1-4.2.1",
"major" : ""
}
},
{
"desc" : "MPlayer SVN",
"ua" : "MPlayer SVN-r33713-4.6.1",
"expect" :
{
"name" : "MPlayer",
"version" : "r33713-4.6.1",
"major" : "undefined"
}
},
{
"desc" : "MPlayer ubuntu",
"ua" : "MPlayer svn r34540 (Ubuntu), built with gcc-4.6",
"expect" :
{
"name" : "MPlayer",
"version" : "r34540",
"major" : "undefined"
}
},
{
"desc" : "MoC",
"ua" : "Music On Console/2.5.0-beta1",
"expect" :
{
"name" : "Music On Console",
"version" : "2.5.0-beta1",
"major" : "2"
}
},
{
"desc" : "MPD",
"ua" : "Music Player Daemon 0.17.4",
"expect" :
{
"name" : "Music Player Daemon",
"version" : "0.17.4",
"major" : "0"
}
},
{
"desc" : "NSPlayer",
"ua" : "NSPlayer/11.0.5358.4827 WMFSDK/11.0",
"expect" :
{
"name" : "NSPlayer",
"version" : "11.0.5358.4827",
"major" : "11"
}
},
{
"desc" : "Nero Home",
"ua" : "Nero Home/1.5.3.0 (compatible; Nero AG; Nero Home 1.5.3.0)",
"expect" :
{
"name" : "Nero Home",
"version" : "1.5.3.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "NexPlayer 4.0 for Android( stagefright alternative )",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "Nokia3xx",
"ua" : "Nokia303/14.87 CLDC-1.1",
"expect" :
{
"name" : "Nokia303",
"version" : "14.87",
"major" : "14"
}
},
{
"desc" : "MPlayer SVN Sherpya",
"ua" : "MPlayer Sherpya-SVN-r33124-4.2.5",
"expect" :
{
"name" : "MPlayer",
"version" : "r33124-4.2.5",
"major" : "undefined"
}
},
{
"desc" : "Philips Songbird",
"ua" : "NotMoz/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) Gecko/20101207 Philips-Songbird/5.4.1980 Songbird/1.9.4 (20110302030555)",
"expect" :
{
"name" : "Songbird",
"version" : "1.9.4",
"major" : "1"
}
},
{
"desc" : "Ossproxy",
"ua" : "OSSProxy 1.3.336.320 (Build 336.320 Win32 en-us)(Aug 16 2013 17:38:43)",
"expect" :
{
"name" : "OSSProxy",
"version" : "1.3.336.320",
"major" : "1"
}
},
{
"desc" : "Winamp3",
"ua" : "Nullsoft Winamp3 version 3.0 (compatible)",
"expect" :
{
"name" : "Winamp",
"version" : "3.0",
"major" : "3"
}
},
{
"desc" : "PSP",
"ua" : "PSP-InternetRadioPlayer/1.00",
"expect" :
{
"name" : "PSP-InternetRadioPlayer",
"version" : "1.00",
"major" : "1"
}
},
{
"desc" : "urllib",
"ua" : "Python-urllib/2.7",
"expect" :
{
"name" : "Python-urllib",
"version" : "2.7",
"major" : "2"
}
},
{
"desc" : "QuickTime",
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
"expect" :
{
"name" : "QuickTime",
"version" : "7.5.6",
"major" : "7"
}
},
{
"desc" : "RMA",
"ua" : "RMA/1.0 (compatible; RealMedia)",
"expect" :
{
"name" : "RMA",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "RadioApp",
"ua" : "RadioApp/1.0 CFNetwork/609.1.4 Darwin/11.4.2",
"expect" :
{
"name" : "RadioApp",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "RadioClientApplication",
"ua" : "RadioClientApplication/20 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "RadioClientApplication",
"version" : "20",
"major" : "undefined"
}
},
{
"desc" : "stagefright",
"ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)",
"expect" :
{
"name" : "stagefright",
"version" : "1.1",
"major" : "1"
}
},
{
"desc" : "Soundtap",
"ua" : "Soundtap/1.2.4 CFNetwork/672.0.2 Darwin/14.0.0",
"expect" :
{
"name" : "Soundtap",
"version" : "1.2.4",
"major" : "1"
}
},
{
"desc" : "Streamium",
"ua" : "Streamium/1.0",
"expect" :
{
"name" : "Streamium",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Totem",
"ua" : "Totem/3.0.1",
"expect" :
{
"name" : "Totem",
"version" : "3.0.1",
"major" : "3"
}
},
{
"desc" : "VLC",
"ua" : "VLC media player - version 0.8.6c Janus - (c) 1996-2007 the VideoLAN team",
"expect" :
{
"name" : "VLC",
"version" : "0.8.6c",
"major" : "0"
}
},
{
"desc" : "VLC",
"ua" : "VLC/2.0.0 LibVLC/2.0.0",
"expect" :
{
"name" : "VLC",
"version" : "2.0.0",
"major" : "2"
}
},
{
"desc" : "Videos",
"ua" : "Videos/3.8.2",
"expect" :
{
"name" : "Video",
"version" : "3.8.2",
"major" : "3"
}
},
{
"desc" : "Wget",
"ua" : "Wget/1.12 (darwin10.7.0)",
"expect" :
{
"name" : "Wget",
"version" : "1.12",
"major" : "1"
}
},
{
"desc" : "Winamp",
"ua" : "Winamp 2.81",
"expect" :
{
"name" : "Winamp",
"version" : "2.81",
"major" : "2"
}
},
{
"desc" : "Winamp",
"ua" : "WinampMPEG/2.00",
"expect" :
{
"name" : "Winamp",
"version" : "2.00",
"major" : "2"
}
},
{
"desc" : "Windows Media Player",
"ua" : "Windows-Media-Player/10.00.00.4019",
"expect" :
{
"name" : "Windows Media Player",
"version" : "10.00.00.4019",
"major" : "10"
}
},
{
"desc" : "XBMC",
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
"expect" :
{
"name" : "XBMC",
"version" : "12.0",
"major" : "12"
}
},
{
"desc" : "rad.io",
"ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)",
"expect" :
{
"name" : "rad.io",
"version" : "1.18.1",
"major" : "1"
}
},
{
"desc" : "BE-Test",
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
"expect" :
{
"name" : "BE Test",
"version" : "1.0",
"major" : "1"
}
}
]

659
node_modules/ua-parser-js/test/os-test.json generated vendored Normal file
View file

@ -0,0 +1,659 @@
[
{
"desc" : "Windows 95",
"ua" : "Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)",
"expect" :
{
"name" : "Windows",
"version" : "95"
}
},
{
"desc" : "Windows 98",
"ua" : "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
"expect" :
{
"name" : "Windows",
"version" : "98"
}
},
{
"desc" : "Windows ME",
"ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90) Gecko/20020502 CS 2000 7.0/7.0",
"expect" :
{
"name" : "Windows",
"version" : "ME"
}
},
{
"desc" : "Windows 2000",
"ua" : "Mozilla/3.0 (compatible; MSIE 3.0; Windows NT 5.0)",
"expect" :
{
"name" : "Windows",
"version" : "2000"
}
},
{
"desc" : "Windows XP",
"ua" : "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 5.2)",
"expect" :
{
"name" : "Windows",
"version" : "XP"
}
},
{
"desc" : "Windows Vista",
"ua" : "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; fr-FR)",
"expect" :
{
"name" : "Windows",
"version" : "Vista"
}
},
{
"desc" : "Windows 7",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)",
"expect" :
{
"name" : "Windows",
"version" : "7"
}
},
{
"desc" : "Windows 8",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
"expect" :
{
"name" : "Windows",
"version" : "8"
}
},
{
"desc" : "Windows 10",
"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",
"expect" :
{
"name" : "Windows",
"version" : "10"
}
},
{
"desc" : "Windows RT",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)",
"expect" :
{
"name" : "Windows",
"version" : "RT"
}
},
{
"desc" : "Windows CE",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)",
"expect" :
{
"name" : "Windows",
"version" : "CE"
}
},
{
"desc" : "Windows Mobile",
"ua" : "Mozilla/5.0 (ZTE-E_N72/N72V1.0.0B02;U;Windows Mobile/6.1;Profile/MIDP-2.0 Configuration/CLDC-1.1;320*240;CTC/2.0) IE/6.0 (compatible; MSIE 4.01; Windows CE; PPC)/UC Browser7.7.1.88",
"expect" :
{
"name" : "Windows Mobile",
"version" : "6.1"
}
},
{
"desc" : "Windows Phone",
"ua" : "Opera/9.80 (Windows Phone; Opera Mini/7.6.8/35.7518; U; ru) Presto/2.8.119 Version/11.10",
"expect" :
{
"name" : "Windows Phone",
"version" : "undefined"
}
},
{
"desc" : "Windows Phone OS",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)",
"expect" :
{
"name" : "Windows Phone OS",
"version" : "7.0"
}
},
{
"desc" : "Windows Phone 8",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; Windows Phone 8X by HTC)",
"expect" :
{
"name" : "Windows Phone",
"version" : "8.0"
}
},
{
"desc" : "BlackBerry",
"ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378",
"expect" :
{
"name" : "BlackBerry",
"version" : "5.0.0.912"
}
},
{
"desc" : "BlackBerry 10",
"ua" : "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+",
"expect" :
{
"name" : "BlackBerry",
"version" : "10"
}
},
{
"desc" : "Tizen",
"ua" : "Mozilla/5.0 (Linux; Tizen 2.3; SAMSUNG SM-Z130H) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.3 Mobile Safari/537.3",
"expect" :
{
"name" : "Tizen",
"version" : "2.3"
}
},
{
"desc" : "Android",
"ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)",
"expect" :
{
"name" : "Android",
"version" : "2.2.2"
}
},
{
"desc" : "Sailfish",
"ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0",
"expect" :
{
"name" : "Sailfish",
"version" : "3.0"
}
},
{
"desc" : "WebOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Palm OS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "QNX",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Bada",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "RIM Tablet OS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "MeeGo",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Symbian",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Firefox OS",
"ua" : "Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0",
"expect" :
{
"name" : "Firefox OS",
"version" : "undefined"
}
},
{
"desc" : "Nintendo",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "PlayStation",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "PlayStation 4",
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
"expect" :
{
"name" : "PlayStation",
"version" : "4"
}
},
{
"desc" : "Mint",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Joli",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Ubuntu",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Ubuntu/12.04 (3.4.1-0ubuntu1) Epiphany/3.4.1",
"expect" :
{
"name" : "Ubuntu",
"version" : "12.04"
}
},
{
"desc" : "Ubuntu",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36",
"expect" :
{
"name" : "Ubuntu",
"version" : "undefined"
}
},
{
"desc" : "Debian",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "OpenSUSE",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Gentoo",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Arch",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Slackware",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Fedora",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Mandriva",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "CentOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "PCLinuxOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "RedHat",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Zenwalk",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Hurd",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Linux",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "GNU",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Chromium OS",
"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" :
{
"name" : "Chromium OS",
"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"
}
},
{
"desc" : "Solaris",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "FreeBSD",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "OpenBSD",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "NetBSD",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "DragonFly",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "iOS in App",
"ua" : "AppName/version CFNetwork/version Darwin/version",
"expect" :
{
"name" : "iOS",
"version" : "undefined"
}
},
{
"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",
"expect" :
{
"name" : "iOS",
"version" : "5.1.1"
}
},
{
"desc" : "iOS with Opera Mini",
"ua" : "Opera/9.80 (iPhone; Opera Mini/7.1.32694/27.1407; U; en) Presto/2.8.119 Version/11.10",
"expect" :
{
"name" : "iOS",
"version" : "undefined"
}
},
{
"desc" : "Mac OS",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",
"expect" :
{
"name" : "Mac OS",
"version" : "10.6.8"
}
},
{
"desc" : "Haiku",
"ua" : "Mozilla/5.0 (Macintosh; Intel Haiku R1 x86) AppleWebKit/602.1.1 (KHTML, like Gecko) WebPositive/1.2 Version/8.0 Safari/602.1.1",
"expect" :
{
"name" : "Haiku",
"version" : "R1"
}
},
{
"desc" : "AIX",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Plan9",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "Minix",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "BeOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "OS/2",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "AmigaOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "MorphOS",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "UNIX",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "iTunes Windows Vista",
"ua" : "iTunes/10.7 (Windows; Microsoft Windows Vista Home Premium Edition Service Pack 1 (Build 6001)) AppleWebKit/536.26.9",
"expect" :
{
"name" : "Windows",
"version" : "Vista"
}
},
{
"desc" : "",
"ua" : "",
"expect" :
{
"name" : "",
"version" : ""
}
},
{
"desc" : "iOS BE App",
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
"expect" :
{
"name" : "iOS",
"version" : "7.0.2"
}
},
{
"desc" : "KTB-Nexus 5",
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
"expect" :
{
"name" : "Android",
"version" : "4.2.1"
}
}
]

113
node_modules/ua-parser-js/test/test.js generated vendored Normal file
View file

@ -0,0 +1,113 @@
var assert = require('assert');
var requirejs = require('requirejs');
var UAParser = require('./../src/ua-parser');
var browsers = require('./browser-test.json');
var cpus = require('./cpu-test.json');
var devices = require('./device-test.json');
var engines = require('./engine-test.json');
var os = require('./os-test.json');
var parser = new UAParser();
var methods = [
{
title : 'getBrowser',
label : 'browser',
list : browsers,
properties : ['name', 'major', 'version']
},
{
title : 'getCPU',
label : 'cpu',
list : cpus,
properties : ['architecture']
},
{
title : 'getDevice',
label : 'device',
list : devices,
properties : ['model', 'type', 'vendor']
},
{
title : 'getEngine',
label : 'engine',
list : engines,
properties : ['name', 'version']
},
{
title : 'getOS',
label : 'os',
list : os,
properties : ['name', 'version']
}];
describe('UAParser()', function () {
var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6';
assert.deepEqual(UAParser(ua), new UAParser().setUA(ua).getResult());
});
for (var i in methods) {
describe(methods[i]['title'], function () {
for (var j in methods[i]['list']) {
if (!!methods[i]['list'][j].ua) {
describe('[' + methods[i]['list'][j].desc + ']', function () {
describe('"' + methods[i]['list'][j].ua + '"', function () {
var expect = methods[i]['list'][j].expect;
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
methods[i]['properties'].forEach(function(m) {
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
});
});
});
});
}
}
});
}
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 () {
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];
var parser1 = new UAParser(uaString, {browser: myOwnBrowser});
assert.equal(parser1.getBrowser().name, 'MyOwnBrowser');
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 () {
it('should loaded automatically', function(done) {
requirejs.config({
baseUrl : 'dist',
paths : {
'ua-parser-js' : 'ua-parser.min'
}
});
requirejs(['ua-parser-js'], function(ua) {
var parser = new ua('Dillo/1.0');
assert.deepEqual(parser.getBrowser().name, 'Dillo');
done();
});
});
});