Merge pull request #2 from amplitude/library-upgrade

Update library fork to latest
This commit is contained in:
qingzhuozhen 2021-09-07 14:12:20 -07:00 committed by GitHub
commit 5c745ccec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 3705 additions and 1033 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: ua-parser-js
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.paypal.me/faisalman/']

17
.github/workflows/run-test.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: ua-parser-js-run-test
on: [push, pull_request]
jobs:
run-test:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, ppc64le]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Run the test
run: |
npm install
npm run test-ci

3
.jshintrc Normal file
View File

@ -0,0 +1,3 @@
{
"esversion": 3
}

View File

@ -1,3 +1,6 @@
arch:
- amd64
- ppc64le
language: node_js language: node_js
node_js: node_js:
- stable - stable
@ -11,3 +14,5 @@ cache:
- node_modules - node_modules
sudo: false sudo: false
script: npm run test-ci

View File

@ -1,6 +1,6 @@
{ {
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.7.21", "version": "0.7.28",
"authors": [ "authors": [
"Faisal Salman <f@faisalman.com>" "Faisal Salman <f@faisalman.com>"
], ],

3
changelog.md Normal file
View File

@ -0,0 +1,3 @@
# UAParser.js Changelog
## Version 0.8.0

13
dist/ua-parser.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2012-2019 Faisal Salman <<f@faisalman.com>> Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
Package.describe({ Package.describe({
name: 'faisalman:ua-parser-js', name: 'faisalman:ua-parser-js',
version: '0.7.21', version: '0.7.28',
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'

View File

@ -1,9 +1,9 @@
{ {
"title": "UAParser.js", "title": "UAParser.js",
"name": "@amplitude/ua-parser-js", "name": "@amplitude/ua-parser-js",
"version": "0.7.24", "version": "0.7.25",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)", "author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Lightweight JavaScript-based user-agent string parser", "description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [ "keywords": [
"user-agent", "user-agent",
"parser", "parser",
@ -20,86 +20,131 @@
"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>", "Alvin Portillo <alvin@8thwall.com>",
"Amumu <yoyo837@hotmail.com>",
"Andrea Vaghi <andrea.vaghi@jobrapido.com>", "Andrea Vaghi <andrea.vaghi@jobrapido.com>",
"Anton Zhiyanov <m@antonz.ru>", "Anton Zhiyanov <m@antonz.ru>",
"Arturo Mejia <amejia@blim.com>", "Arturo Mejia <amejia@blim.com>",
"Arun Rama Reddy <arunramareddy@gmail.com>", "Arun Rama Reddy <arunramareddy@gmail.com>",
"Austin Pray <austin@austinpray.com>", "Austin Pray <austin@austinpray.com>",
"Bendeguz <symunona@gmail.com>",
"Benjamin Bertrand <bertrand.design@gmail.com>", "Benjamin Bertrand <bertrand.design@gmail.com>",
"Benjamin Urban <benjamin.urban@sueddeutsche.de>", "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>",
"Chad Killingsworth <ckillingsworth@jackhenry.com>",
"Christopher De Cairos <chris.decairos@gmail.com>", "Christopher De Cairos <chris.decairos@gmail.com>",
"Cyrille David <cyrille@qonto.eu>",
"Dario Vladovic <d.vladimyr@gmail.com>", "Dario Vladovic <d.vladimyr@gmail.com>",
"David Annez <david.annez@gmail.com>",
"Davit Barbakadze <jayarjo@gmail.com>", "Davit Barbakadze <jayarjo@gmail.com>",
"ddivernois <david-emmanuel.divernois@amadeus.com>", "ddivernois <david-emmanuel.divernois@amadeus.com>",
"Deliaz <D3liaz@gmail.com>",
"Demis Palma <demis.palma@gmail.com>", "Demis Palma <demis.palma@gmail.com>",
"dhoko <aurelien@protonmail.com>", "dhoko <aurelien@protonmail.com>",
"dianhe <dianhe@webank.com>", "dianhe <dianhe@webank.com>",
"dineshks1 <dineshks1@d.kumar44@outlook.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>",
"Dustin <duburns@fanatics.com>",
"Elchin Valiyev <elchin.valiyev@autodesk.com>",
"Emil Hesslow <hesslow@gmail.com>",
"Eric Redon <eric.redon@coox.org>",
"Eric Schrenker <eric.schrenker@gmail.com>", "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 <f@faisalman.com>",
"Frédéric Camblor <fcamblor@gmail.com>", "Frédéric Camblor <fcamblor@gmail.com>",
"Frederik Ring <frederik.ring@gmail.com>",
"Gerald Host <me@jacobford.co.uk>",
"Germán M. Bravo <german.mb@gmail.com>", "Germán M. Bravo <german.mb@gmail.com>",
"Grigory Dmitrenko <grigory@snsk.ru>", "Grigory Dmitrenko <grigory@snsk.ru>",
"gulpin <gulping.gulpin@gmail.com>",
"Hendrik Helwich <h.helwich@iplabs.de>", "Hendrik Helwich <h.helwich@iplabs.de>",
"Hermann Ebert <ebbmo@HE.local>", "Hermann Ebert <ebbmo@HE.local>",
"hr6r <hedian@gmail.com>",
"Igor Topal <i.topal@smartweb.com.ua>",
"Ildar Kamalov <i.kamalov@adguard.com>",
"insanehong <insane.hong@navercorp.com>",
"jackpoll <jackpoll123456@gmail.com>", "jackpoll <jackpoll123456@gmail.com>",
"Jake Mc <startswithaj@users.noreply.github.com>", "Jake Mc <startswithaj@users.noreply.github.com>",
"JBYoshi <12983479+JBYoshi@users.noreply.github.com>",
"Joey Parrish <joeyparrish@google.com>",
"John Tantalo <john.tantalo@gmail.com>", "John Tantalo <john.tantalo@gmail.com>",
"John Yanarella <jmy@codecatalyst.com>", "John Yanarella <jmy@codecatalyst.com>",
"Jon Buckley <jon@jbuckley.ca>", "Jon Buckley <jon@jbuckley.ca>",
"Josh Goldberg <joshuakgoldberg@outlook.com>",
"Junki-Ishida <junki_ishida@dwango.co.jp>",
"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 <balogh.levente.hu@gmail.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>",
"ll-syber <670159357@qq.com>",
"Loris Guignard <loris.guignard@gmail.com>", "Loris Guignard <loris.guignard@gmail.com>",
"Lukas Drgon <lukas.drgon@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 <martynas@firmfirm.co>", "Martynas <martynas@firmfirm.co>",
"Masahiko Sato <masasato@yahoo-corp.jp>",
"Matt Brophy <matt@brophy.org>", "Matt Brophy <matt@brophy.org>",
"Max Maurer <maxemanuel.maurer@gmail.com>", "Matthew Origer <karatecowboy@gmail.com>",
"Maximilian Haupt <mail@maximilianhaupt.com>", "Maximilian Haupt <mail@maximilianhaupt.com>",
"Max Maurer <maxemanuel.maurer@gmail.com>",
"Max Nordlund <max.nordlund@gmail.com>",
"Michael Hess <mhess@connectify.me>", "Michael Hess <mhess@connectify.me>",
"MimyyK <michele.marais@hakisa.com>",
"naoh <naoh.cs03g@nctu.edu.tw>", "naoh <naoh.cs03g@nctu.edu.tw>",
"Nicholas Ionata <nionata@ufl.edu>",
"Nikhil Motiani <nikhil.motiani@outlook.com>",
"Nik Rolls <nik@rolls.cc>", "Nik Rolls <nik@rolls.cc>",
"Nikhil Motiani <nikhil.m@247-inc.com>", "nionata <n.ionata129@gmail.com>",
"niris <nirisix@gmail.com>", "niris <nirisix@gmail.com>",
"Nobuo Okada <nookada@yahoo-corp.jp>", "Nobuo Okada <nookada@yahoo-corp.jp>",
"o.drapeza <o.drapeza@tinkoff.ru>",
"otakuSiD <otakusid@gmail.com>", "otakuSiD <otakusid@gmail.com>",
"patrick-nurt <github@pereira.dk>",
"Pavel Studeny <studeny@avast.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>", "Piper Chester <piperchester@gmail.com>",
"Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>",
"Raine Makelainen <raine.makelainen@jolla.com>",
"Raman Savaryn <homeneartheocean@gmail.com>",
"Robert Tod <robert@qubit.com>", "Robert Tod <robert@qubit.com>",
"roman.savarin <roman.savarin@skywindgroup.com>",
"Ron Korland <ron@testim.io>", "Ron Korland <ron@testim.io>",
"Ross Noble <rosshnoble@gmail.com>", "Ross Noble <rosshnoble@gmail.com>",
"ruicong <466403866@qq.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>", "Shreedhar <shreedhar@uber.com>",
"Simon Eisenmann <simon@longsleep.org>", "Simon Eisenmann <simon@longsleep.org>",
"Simon Lang <me@simonlang.org>", "Simon Lang <me@simonlang.org>",
"Stiekel <histkc@gmail.com>", "Stiekel <histkc@gmail.com>",
"sUP <dani3l@gmail.com>",
"Sylvain Gizard <sylvain.gizard@gmail.com>", "Sylvain Gizard <sylvain.gizard@gmail.com>",
"szchenghuang <szchenghuang@gmail.com>", "szchenghuang <szchenghuang@gmail.com>",
"Tanguy Krotoff <tkrotoff@gmail.com>",
"Tony Tomarchio <tony@tomarchio.cc>",
"Ulrich Schmidt <u.schmidt@velian.de>",
"Vadim Kurachevsky <vadim@hmvs.org>", "Vadim Kurachevsky <vadim@hmvs.org>",
"Yun Young-jin <yupmin@yupmin-office-macmini.local>" "Yılmaz <yilmazdemir36@gmail.com>",
"yuanyang <work_yuanyang@163.com>",
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
"Zach Bjornson <zbbjornson@gmail.com>"
], ],
"main": "src/ua-parser.js", "main": "src/ua-parser.js",
"scripts": { "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", "build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js", "test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
"test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js",
"verup": "node ./node_modules/verup", "verup": "node ./node_modules/verup",
"version": "node ./node_modules/verup 0" "version": "node ./node_modules/verup 0"
}, },
@ -115,10 +160,11 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"jshint": "~1.1.0", "jshint": "~2.12.0",
"mocha": "~7.0.0", "mocha": "~8.2.0",
"requirejs": "^2.3.2", "requirejs": "^2.3.2",
"uglify-js": "~2.7.5", "safe-regex": "^2.1.1",
"uglify-js": "~3.12.0",
"verup": "^1.3.x" "verup": "^1.3.x"
}, },
"repository": { "repository": {
@ -136,5 +182,15 @@
}, },
"bugs": "https://github.com/amplitude/ua-parser-js/issues", "bugs": "https://github.com/amplitude/ua-parser-js/issues",
"demo": "https://faisalman.github.io/ua-parser-js", "demo": "https://faisalman.github.io/ua-parser-js",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js" "download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/ua-parser-js"
},
{
"type": "paypal",
"url": "https://paypal.me/faisalman"
}
]
} }

210
readme.md
View File

@ -1,18 +1,26 @@
<p align="center">
<img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/logo.png" width="256" height="256">
</p>
<p align="center">
<a href="https://travis-ci.org/faisalman/ua-parser-js"><img src="https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master"></a>
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/v/ua-parser-js.svg"></a>
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/dw/ua-parser-js.svg"></a>
<a href="https://www.jsdelivr.com/package/npm/ua-parser-js"><img src="https://data.jsdelivr.com/v1/package/npm/ua-parser-js/badge"></a>
<a href="https://cdnjs.com/libraries/UAParser.js"><img src="https://img.shields.io/cdnjs/v/UAParser.js.svg"></a>
</p>
# 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 (~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. JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data with relatively small footprint (~17KB minified, ~6KB gzipped) that can be used either in browser (client-side) or node.js (server-side).
[![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>> * Author : Faisal Salman <<f@faisalman.com>>
* Demo : http://faisalman.github.io/ua-parser-js * Demo : https://faisalman.github.io/ua-parser-js
* Source : https://github.com/faisalman/ua-parser-js * Source : https://github.com/faisalman/ua-parser-js
# Constructor # Documentation
## Constructor
* `new UAParser([uastring][,extensions])` * `new UAParser([uastring][,extensions])`
* returns new instance * returns new instance
@ -20,43 +28,44 @@
* `UAParser([uastring][,extensions])` * `UAParser([uastring][,extensions])`
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
# Methods ## Methods
* `getBrowser()` * `getBrowser()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
```sh ```sh
# Possible 'browser.name': # Possible 'browser.name':
2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG, 2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG,
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera, BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
Dolphin, Doris, Edge, Epiphany, Facebook, Falkon, Fennec, Firebird, Firefox, Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird,
Flock, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe,
Iceape, Iceweasel, Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror, IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon,
LBBROWSER Line, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Kindle, Klar, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser,
Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront, Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic,
NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser, OmniWeb, Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo, Oculus Browser,
Opera Coast, Opera Mini, Opera Mobi, Opera Tablet, Opera, PaleMoon, PhantomJS, OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix,
Phoenix, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari,
RockMelt, Safari, Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim,
Sleipnir, Slim, SlimBrowser, Swiftfox, Tizen Browser, UCBrowser, Vivaldi, SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, UP.Browser, Vivaldi,
Waterfox, WeChat, Yandex, baidu, iCab, w3m, ... Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
# 'browser.version' determined dynamically # 'browser.version' determined dynamically
``` ```
* `getDevice()` * `getDevice()`
* returns `{ model: '', type: '', vendor: '' }` * returns `{ model: '', type: '', vendor: '' }`
```sh ```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, Essential, Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG,
Nexian, Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron, Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya,
RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ... Palm, Panasonic, Pebble, Polytron, Realme, RIM, Roku, Samsung, Sharp, Siemens,
Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
# 'device.model' determined dynamically # 'device.model' determined dynamically
``` ```
@ -66,7 +75,7 @@ RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ...
```sh ```sh
# Possible 'engine.name' # Possible 'engine.name'
Amaya, Blink, EdgeHTML, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront,
NetSurf, Presto, Tasman, Trident, w3m, WebKit NetSurf, Presto, Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically # 'engine.version' determined dynamically
@ -77,13 +86,13 @@ NetSurf, Presto, Tasman, Trident, w3m, WebKit
```sh ```sh
# Possible 'os.name' # Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
Contiki, Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU, Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS,
Haiku, Hurd, iOS, Joli, KaiOS, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HP-UX, Hurd, iOS, Joli, KaiOS, Linpus, Linspire,
Minix, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix, Mint, Morph OS, NetBSD,
PCLinuxOS, Plan9, Playstation, QNX, RedHat, RIM Tablet OS, RISC OS, Sailfish, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX,
Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, Raspbian, RedHat, RIM Tablet OS, RISC OS, Sabayon, Sailfish, Series40, Slackware, Solaris,
WebOS, Windows [Phone/Mobile], Zenwalk, ... SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
# 'os.version' determined dynamically # 'os.version' determined dynamically
``` ```
@ -93,7 +102,7 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
```sh ```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/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
``` ```
* `getResult()` * `getResult()`
@ -103,11 +112,12 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
* returns UA string of current instance * returns UA string of current instance
* `setUA(uastring)` * `setUA(uastring)`
* set UA string to parse * set UA string to be parsed
* returns current instance * returns current instance
# Usage
# Example ## Using HTML
```html ```html
<!doctype html> <!doctype html>
@ -117,16 +127,15 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
<script> <script>
var parser = new UAParser(); var parser = new UAParser();
// by default it takes ua string from current browser's window.navigator.userAgent
console.log(parser.getResult()); console.log(parser.getResult());
/* /*
/// this will print an object structured like this: /// This will print an object structured like this:
{ {
ua: "", ua: "",
browser: { browser: {
name: "", name: "",
version: "" version: "",
major: "" //@deprecated
}, },
engine: { engine: {
name: "", name: "",
@ -146,14 +155,14 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
} }
} }
*/ */
// Default result depends on current window.navigator.userAgent value
// let's test a custom user-agent string as an example // Now let's try 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"; var uastring1 = "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); parser.setUA(uastring1);
var result = parser.getResult(); var result = parser.getResult();
// this will also produce the same result (without instantiation): // You can also use UAParser constructor directly without having to create an instance:
// var result = UAParser(uastring); // var result = UAParser(uastring1);
console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"} console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"}
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined} console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
@ -162,7 +171,7 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
console.log(result.engine.name); // "WebKit" console.log(result.engine.name); // "WebKit"
console.log(result.cpu.architecture); // "amd64" console.log(result.cpu.architecture); // "amd64"
// do some other tests // Do some other tests
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)"; 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.setUA(uastring2).getBrowser().name); // "Konqueror"
console.log(parser.getOS()); // {name: "OpenBSD", version: undefined} console.log(parser.getOS()); // {name: "OpenBSD", version: undefined}
@ -201,40 +210,6 @@ http.createServer(function (req, res) {
console.log('Server running at http://127.0.0.1:1337/'); 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 ## Using TypeScript
```sh ```sh
@ -245,18 +220,18 @@ $ npm install --save @types/ua-parser-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, this library will automatically detect if jQuery/Zepto is present and create `$.ua` object (with values based on its User-Agent) along with `window.UAParser` constructor. To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
```js ```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': // Say we are in a 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 // Get the details
console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"} 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", version: "2.3.4"}
console.log($.ua.os.name); // "Android" 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" 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 // Now lets try to reset to another 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'); $.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 // Test again
@ -270,54 +245,49 @@ console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4
$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type); $('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type);
``` ```
## Extending regex patterns ## Using Extension
* `UAParser([uastring,] extensions)` * `UAParser([uastring,] extensions)`
Pass your own regexes to extend the limited matching rules.
```js ```js
// Example: // Example:
var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]]; var myOwnListOfBrowsers = [
var myParser = new UAParser({ browser: myOwnRegex }); [/(mybrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3'; ];
console.log(myParser.setUA(uaString).getBrowser()); // {name: "MyOwnBrowser", version: "1.3"} var myParser = new UAParser({ browser: myOwnListOfBrowsers });
var myUA = 'Mozilla/5.0 MyBrowser/1.3';
console.log(myParser.setUA(myUA).getBrowser()); // {name: "MyBrowser", version: "1.3"}
``` ```
# Development # Development
## Contribute ## Sponsors
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/backers.svg?avatarHeight=64" height="80"/></a> <a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/sponsors.svg?avatarHeight=64" height="80"/></a>
<a href="https://www.paypal.me/faisalman/"><img src="https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg" height="40"></a>
## Contributors
<a href="https://github.com/faisalman/ua-parser-js/graphs/contributors">
<img src="https://contrib.rocks/image?repo=faisalman/ua-parser-js" />
</a>
Made with [contributors-img](https://contrib.rocks).
## How To Contribute
* Fork and clone this repository * Fork and clone this repository
* Make some changes as required * Make some changes as required
* Write a unit test to showcase your feature * Write unit test to showcase its functionality
* Run the test suites to make sure the changes you made didn't break anything `$ npm run test` * Run the test suites to make sure it's not breaking anything `$ npm test`
* Commit and push to your own repository * Submit a pull request under `develop` branch
* 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 # License
MIT License MIT License
Copyright (c) 2012-2019 Faisal Salman <<f@faisalman.com>> Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

File diff suppressed because it is too large Load Diff

View File

@ -159,6 +159,16 @@
"major" : "2" "major" : "2"
} }
}, },
{
"desc" : "Camino on Mac",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1",
"expect" :
{
"name" : "Camino",
"version" : "2.2.1",
"major" : "2"
}
},
{ {
"desc" : "Chimera", "desc" : "Chimera",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6", "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6",
@ -214,7 +224,7 @@
"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",
"expect" : "expect" :
{ {
"name" : "Chrome Mobile", "name" : "Chrome",
"version" : "19.0.1084.60", "version" : "19.0.1084.60",
"major" : "19" "major" : "19"
} }
@ -234,11 +244,21 @@
"ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7", "ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7",
"expect" : "expect" :
{ {
"name" : "Chrome Mobile", "name" : "Chrome",
"version" : "16.0.912.75", "version" : "16.0.912.75",
"major" : "16" "major" : "16"
} }
}, },
{
"desc" : "Coc Coc Browser",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/78.0.129 Chrome/72.0.3626.129 Safari/537.36",
"expect" :
{
"name" : "Coc Coc",
"version" : "78.0.129",
"major" : "78"
}
},
{ {
"desc" : "Dillo", "desc" : "Dillo",
"ua" : "Dillo/2.2", "ua" : "Dillo/2.2",
@ -279,6 +299,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "Flow",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)",
"expect" :
{
"name" : "Flow",
"version" : "5.7.4",
"major" : "5"
}
},
{ {
"desc" : "Waterfox", "desc" : "Waterfox",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2",
@ -310,7 +340,7 @@
} }
}, },
{ {
"desc" : "Facebook in-App Browser for Android", "desc" : "Facebook in-App Browser for Android with version",
"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" :
{ {
@ -320,7 +350,7 @@
} }
}, },
{ {
"desc" : "Facebook in-App Browser for iOS", "desc" : "Facebook in-App Browser for iOS with version",
"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])", "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" : "expect" :
{ {
@ -329,6 +359,26 @@
"major" : "91" "major" : "91"
} }
}, },
{
"desc" : "Facebook in-App Browser for iOS without version",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone10,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]",
"expect" :
{
"name" : "Facebook",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Instagram in-App Browser for iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 142.0.0.22.109 (iPhone12,5; iOS 14_1; en_US; en-US; scale=3.00; 1242x2688; 214888322) NW/1",
"expect" :
{
"name" : "Instagram",
"version" : "142.0.0.22.109",
"major" : "142"
}
},
{ {
"desc" : "Falkon", "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", "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",
@ -359,6 +409,26 @@
"major" : "15" "major" : "15"
} }
}, },
{
"desc" : "Firefox Reality",
"ua" : "Mozilla/5.0 (Android 7.1.2; Mobile VR; rv:65.0) Gecko/65.0 Firefox/65.0",
"expect" :
{
"name" : "Firefox Reality",
"version" : "65.0",
"major" : "65"
}
},
{
"desc" : "Firefox-based browser",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 AppName/1.0",
"expect" :
{
"name" : "Firefox",
"version" : "80.0",
"major" : "80"
}
},
{ {
"desc" : "Fennec", "desc" : "Fennec",
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
@ -369,6 +439,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "Firefox for Maemo (Nokia N900)",
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
"expect" :
{
"name" : "Fennec",
"version" : "10.0.1",
"major" : "10"
}
},
{ {
"desc": "Firefox Focus", "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", "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",
@ -668,6 +748,16 @@
"major" : "8" "major" : "8"
} }
}, },
{
"desc" : "Netscape 6",
"ua" : "Mozilla/5.0 (Windows; U; Win95; de-DE; rv:0.9.2) Gecko/20010726 Netscape6/6.1",
"expect" :
{
"name" : "Netscape",
"version" : "6.1",
"major" : "6"
}
},
{ {
"desc" : "Nokia Browser", "desc" : "Nokia Browser",
"ua" : "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/025.007; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba", "ua" : "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/025.007; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba",
@ -678,6 +768,26 @@
"major" : "7" "major" : "7"
} }
}, },
{
"desc" : "Obigo",
"ua" : "LG-GS290/V100 Obigo/WAP2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1",
"expect" :
{
"name" : "Obigo",
"version" : "WAP2.0",
"major" : "2"
}
},
{
"desc" : "Obigo",
"ua" : "LG/KU990i/v10a Browser/Obigo-Q05A/3.6 MMS/LG-MMS-V1.0/1.2 Java/ASVM/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"expect" :
{
"name" : "Obigo",
"version" : "Q05A",
"major" : "05"
}
},
{ {
"desc" : "Oculus Browser", "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", "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",
@ -898,6 +1008,16 @@
"major" : "2" "major" : "2"
} }
}, },
{
"desc" : "SeaMonkey on Mac",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
"expect" :
{
"name" : "SeaMonkey",
"version" : "2.7.1",
"major" : "2"
}
},
{ {
"desc" : "Silk Browser", "desc" : "Silk Browser",
"ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)", "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)",
@ -938,6 +1058,26 @@
"major" : "undefined" "major" : "undefined"
} }
}, },
{
"desc" : "Tesla",
"ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1",
"expect" :
{
"name" : "Tesla",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Tesla",
"ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/537.36 (KHTML, like Gecko) Chromium/79.0.3945.130 Chrome/79.0.3945.130 Safari/537.36 Tesla/2020.16.2.1-e99c70fff409",
"expect" :
{
"name" : "Tesla",
"version" : "2020.16.2.1-e99c70fff409",
"major" : "2020"
}
},
{ {
"desc" : "Tizen Browser", "desc" : "Tizen Browser",
"ua" : "Mozilla/5.0 (Linux; U; Tizen/1.0 like Android; en-us; AppleWebKit/534.46 (KHTML, like Gecko) Tizen Browser/1.0 Mobile", "ua" : "Mozilla/5.0 (Linux; U; Tizen/1.0 like Android; en-us; AppleWebKit/534.46 (KHTML, like Gecko) Tizen Browser/1.0 Mobile",
@ -1008,6 +1148,16 @@
"major" : "7" "major" : "7"
} }
}, },
{
"desc" : "UPBrowser",
"ua" : "BenQ-CF61/1.00/WAP2.0/MIDP2.0/CLDC1.0 UP.Browser/6.3.0.4.c.1.102 (GUI) MMP/2.0",
"expect" :
{
"name" : "UP.Browser",
"version" : "6.3.0.4.c.1.102",
"major" : "6"
}
},
{ {
"desc": "WeChat on iOS", "desc": "WeChat on iOS",
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 MicroMessenger/6.3.6 NetType/WIFI Language/zh_CN", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 MicroMessenger/6.3.6 NetType/WIFI Language/zh_CN",
@ -1028,6 +1178,16 @@
"major": "6" "major": "6"
} }
}, },
{
"desc": "WeChat on Android",
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366 Weibo (iPhone8,2__weibo__8.9.3__iphone__os12.0)",
"expect":
{
"name": "weibo",
"version": "8.9.3",
"major": "8"
}
},
{ {
"desc" : "Vivaldi", "desc" : "Vivaldi",
"ua" : "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.83.38 Safari/537.36", "ua" : "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.83.38 Safari/537.36",
@ -1059,7 +1219,7 @@
} }
}, },
{ {
"desc" : "Microsoft Edge", "desc" : "Microsoft Edge 0.1",
"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",
"expect" : "expect" :
{ {
@ -1068,6 +1228,26 @@
"major" : "12" "major" : "12"
} }
}, },
{
"desc" : "Microsoft Edge 42",
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134",
"expect" :
{
"name" : "Edge",
"version" : "17.17134",
"major" : "17"
}
},
{
"desc" : "Microsoft Edge 44",
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763",
"expect" :
{
"name" : "Edge",
"version" : "18.17763",
"major" : "18"
}
},
{ {
"desc" : "Microsoft Edge on iOS", "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", "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",
@ -1118,6 +1298,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "Firefox iOS using iPad",
"ua" : "Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",
"expect" :
{
"name" : "Firefox",
"version" : "1.0",
"major" : "1"
}
},
{ {
"desc" : "QQ on iOS", "desc" : "QQ on iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26", "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26",
@ -1168,6 +1358,16 @@
"major" : "3" "major" : "3"
} }
}, },
{
"desc" : "WeChat Desktop for Windows Built-in Browser major version in 4",
"ua" : "mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/53.0.2785.116 safari/537.36 qbcore/4.0.1301.400 qqbrowser/9.0.2524.400 mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/81.0.4044.138 safari/537.36 nettype/wifi micromessenger/7.0.20.1781(0x6700143b) windowswechat",
"expect" :
{
"name" : "WeChat(Win) Desktop",
"version" : "4.0.1301.400",
"major" : "4"
}
},
{ {
"desc" : "GSA on iOS", "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", "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",
@ -1200,7 +1400,7 @@
"expect" : "expect" :
{ {
"name" : "BIDUBrowser", "name" : "BIDUBrowser",
"version" : "8.7", "version" : "8.7",
"major" : "8" "major" : "8"
} }
}, },
@ -1233,5 +1433,25 @@
"version" : "4.5.16", "version" : "4.5.16",
"major" : "4" "major" : "4"
} }
},
{
"desc" : "Whale Browser",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Whale/2.6.90.14 Safari/537.36",
"expect" :
{
"name" : "Whale",
"version" : "2.6.90.14",
"major" : "2"
}
},
{
"desc" : "Electron",
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Atom/1.41.0 Chrome/69.0.3497.128 Electron/4.2.7 Safari/537.36",
"expect" :
{
"name" : "Electron",
"version" : "4.2.7",
"major" : "4"
}
} }
] ]

View File

@ -40,7 +40,15 @@
} }
}, },
{ {
"desc" : "ARMv6", "desc" : "ARM",
"ua" : "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 635) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "ARMv61",
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
"expect" : "expect" :
{ {
@ -49,12 +57,76 @@
}, },
{ {
"desc" : "ARMv7", "desc" : "ARMv7",
"ua" : "Mozilla/5.0 (Linux ARMv7) WebKitGTK+/3.4.9 vimprobable2",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "ARMv7l",
"ua" : "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "ARMv7l",
"ua" : "Mozilla/5.0 (X11; CrOS armv7l 9765.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.123 Safari/537.36", "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" : "expect" :
{ {
"architecture" : "arm" "architecture" : "arm"
} }
}, },
{
"desc" : "Nokia N900 Linux mobile",
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "ARMEABI",
"ua" : "[FBAN/FB4A;FBAV/237.0.0.44.120;FBBV/170693408;FBDM/{density=1.75,width=720,height=1280};FBLC/en_US;FBRV/172067074;FBCR/ ;FBMF/samsung;FBBD/samsung;FBPN/com.facebook.katana;FBDV/SM-S367VL;FBSV/9;FBBK/1;FBOP/19;FBCA/armeabi-v7a:armeabi;]",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "ARMv8",
"ua" : "Mozilla/5.0 (X11; Linux armv8l; rv:45.0) Gecko/20100101 Firefox/45.0",
"expect" :
{
"architecture" : "arm64"
}
},
{
"desc" : "AARCH64",
"ua" : "Mozilla/5.0 (X11; CrOS aarch64 13310.93.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.133 Safari/537.36",
"expect" :
{
"architecture" : "arm64"
}
},
{
"desc" : "ARM64",
"ua" : "Mozilla/5.0 (Windows NT 10.0; ARM64; RM-1096) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393",
"expect" :
{
"architecture" : "arm64"
}
},
{
"desc" : "ARM64",
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 9; HRY-LX1T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 YaBrowser/19.12.1.121.00 Mobile Safari/537.36",
"expect" :
{
"architecture" : "arm64"
}
},
{ {
"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",
@ -87,6 +159,14 @@
"architecture" : "ppc" "architecture" : "ppc"
} }
}, },
{
"desc" : "Mac OS X on PowerPC using Firefox",
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"architecture" : "ppc"
}
},
{ {
"desc" : "UltraSPARC", "desc" : "UltraSPARC",
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5", "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
@ -95,6 +175,14 @@
"architecture" : "sparc" "architecture" : "sparc"
} }
}, },
{
"desc" : "sparc64",
"ua" : "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)",
"expect" :
{
"architecture" : "sparc64"
}
},
{ {
"desc" : "QuickTime", "desc" : "QuickTime",
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)", "ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
@ -110,5 +198,13 @@
{ {
"architecture" : "amd64" "architecture" : "amd64"
} }
},
{
"desc" : "IRIX64",
"ua" : "Mozilla/4.8C-SGI [en] (X11; U; IRIX64 6.5 IP27",
"expect" :
{
"architecture" : "irix64"
}
} }
] ]

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,15 @@
"version" : "12.0" "version" : "12.0"
} }
}, },
{
"desc" : "Flow",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)",
"expect" :
{
"name" : "Flow",
"version" : "5.7.4.30559"
}
},
{ {
"desc" : "Gecko", "desc" : "Gecko",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
@ -97,5 +106,50 @@
"name" : "WebKit", "name" : "WebKit",
"version" : "537.36" "version" : "537.36"
} }
},
{
"desc" : "WebOS TV 5.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "68.0.3440.106"
}
},
{
"desc" : "WebOS TV 4.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "53.0.2785.34"
}
},
{
"desc" : "WebOS TV 3.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "38.0.2125.122"
}
},
{
"desc" : "WebOS TV 2.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2",
"expect" :
{
"name" : "WebKit",
"version" : "538.2"
}
},
{
"desc" : "WebOS TV 1.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41",
"expect" :
{
"name" : "WebKit",
"version" : "537.41"
}
} }
] ]

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long