mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-15 22:52:16 +03:00
Compare commits
302 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8087a1b4f0 | ||
|
|
d30ad46992 | ||
|
|
5302e2df6a | ||
|
|
f3de7b7cea | ||
|
|
c41100ebb5 | ||
|
|
23c5d7765d | ||
|
|
e3d5f7649d | ||
|
|
02af42fcf0 | ||
|
|
57d1ac05f5 | ||
|
|
ea2c82948f | ||
|
|
3b896d50b7 | ||
|
|
5a724cbde8 | ||
|
|
c76139632f | ||
|
|
310cab9c3a | ||
|
|
c6dea6361c | ||
|
|
daab1e76f8 | ||
|
|
f78e468020 | ||
|
|
056f5e358f | ||
|
|
91f3185eb2 | ||
|
|
9bcfbe2460 | ||
|
|
eeaf198197 | ||
|
|
59edeef380 | ||
|
|
f92d409909 | ||
|
|
5af24a6cf7 | ||
|
|
d810feb844 | ||
|
|
32d326b35b | ||
|
|
786d502b01 | ||
|
|
5b8adfef7b | ||
|
|
2e06a34062 | ||
|
|
bf9ac43328 | ||
|
|
3f8b5ba9cf | ||
|
|
1747707be6 | ||
|
|
d41404551f | ||
|
|
ba067bd351 | ||
|
|
a486f28732 | ||
|
|
3218051f07 | ||
|
|
551ad88474 | ||
|
|
097f736c4d | ||
|
|
73c25771dc | ||
|
|
f8e5a1fb4f | ||
|
|
c9d1ab9561 | ||
|
|
f815ca6e9c | ||
|
|
0cbeb7a829 | ||
|
|
bf4fb916ca | ||
|
|
68447d883a | ||
|
|
0b0c7ff617 | ||
|
|
5b2e80bdfd | ||
|
|
ba0f25c19d | ||
|
|
4d3048aaaa | ||
|
|
97e4a89685 | ||
|
|
1a521b867f | ||
|
|
5d4ca2b4c2 | ||
|
|
cf093222e5 | ||
|
|
f2d0db001d | ||
|
|
a6140a17dd | ||
|
|
2033eb4aba | ||
|
|
a886604935 | ||
|
|
b814bcd791 | ||
|
|
df7551c9b6 | ||
|
|
94f2d604d1 | ||
|
|
e5942dc505 | ||
|
|
4ef9841592 | ||
|
|
528e7aea1c | ||
|
|
5e33df3b6b | ||
|
|
a8a4e71345 | ||
|
|
1f6a7e2860 | ||
|
|
db5567d614 | ||
|
|
2f7017b4d5 | ||
|
|
8ffdf232f4 | ||
|
|
98096f1454 | ||
|
|
5fd47ee00d | ||
|
|
6fde0d92d6 | ||
|
|
7f71024161 | ||
|
|
c239ac5167 | ||
|
|
8d3c2d327c | ||
|
|
d11fc47dc9 | ||
|
|
b490110109 | ||
|
|
cb5da5ea4b | ||
|
|
b2d685dd9c | ||
|
|
8d21e34201 | ||
|
|
48d930f0f1 | ||
|
|
55b5b40c7d | ||
|
|
d141915d45 | ||
|
|
8483ac09b3 | ||
|
|
896bdd04e4 | ||
|
|
25fff62540 | ||
|
|
ea04d018bb | ||
|
|
29b613deee | ||
|
|
238391a977 | ||
|
|
384f780a70 | ||
|
|
75e58525fe | ||
|
|
ebb32d1ad9 | ||
|
|
dea39e1693 | ||
|
|
ca417e25a9 | ||
|
|
f54d3fadac | ||
|
|
21fe76742f | ||
|
|
30ac448a0c | ||
|
|
1e82d7d265 | ||
|
|
a5cdc2975b | ||
|
|
180846b80a | ||
|
|
061a7a6145 | ||
|
|
ebebf0acb3 | ||
|
|
15ae12b71d | ||
|
|
4f77fbb441 | ||
|
|
cd25bc1866 | ||
|
|
534ba7dd7c | ||
|
|
0b423078c8 | ||
|
|
779b5dc1e5 | ||
|
|
18a4e5ade2 | ||
|
|
534d577355 | ||
|
|
fe963b58e5 | ||
|
|
6e39c8a553 | ||
|
|
3d4ec6ef3b | ||
|
|
f02a431000 | ||
|
|
b6bddd8c09 | ||
|
|
a29213960c | ||
|
|
f761a89ab2 | ||
|
|
7ddb2575bd | ||
|
|
23ad60ea68 | ||
|
|
97f3368ef0 | ||
|
|
b86860e850 | ||
|
|
157af1e2f2 | ||
|
|
b4cfe1b624 | ||
|
|
95fea1cb26 | ||
|
|
30648cef1d | ||
|
|
10c978eca5 | ||
|
|
fbd2c6853c | ||
|
|
29d5e43342 | ||
|
|
051aa5d284 | ||
|
|
139fbc321a | ||
|
|
191fed9127 | ||
|
|
8fe448fddf | ||
|
|
343d584f8f | ||
|
|
ef54fd35d6 | ||
|
|
79535f5d61 | ||
|
|
ee743946e8 | ||
|
|
f57bd9523d | ||
|
|
ffc03acd64 | ||
|
|
62cc99d7cf | ||
|
|
b542df155a | ||
|
|
15aa73de40 | ||
|
|
336ce2b950 | ||
|
|
20a428c351 | ||
|
|
47c310e203 | ||
|
|
825edbbf91 | ||
|
|
299283c436 | ||
|
|
39e8d4af03 | ||
|
|
03c915277a | ||
|
|
1e7b6d2e8b | ||
|
|
e5e13adc81 | ||
|
|
837042a3e8 | ||
|
|
7b3aa9fc15 | ||
|
|
8e55e00177 | ||
|
|
ca644313d6 | ||
|
|
ca83d4c9c3 | ||
|
|
9bed2b1437 | ||
|
|
3792900410 | ||
|
|
c05e4e837f | ||
|
|
c53a2a1f72 | ||
|
|
559ecaacb6 | ||
|
|
f715023f47 | ||
|
|
36b2275add | ||
|
|
75620c7b6c | ||
|
|
1d3c98a10c | ||
|
|
c39590b673 | ||
|
|
9200e53787 | ||
|
|
6c671dd246 | ||
|
|
535f11bd24 | ||
|
|
642c0399e8 | ||
|
|
3edacddb24 | ||
|
|
acc0b91ff5 | ||
|
|
f726dcd1ae | ||
|
|
383ca587ef | ||
|
|
7c8aa435b2 | ||
|
|
09aa9105dc | ||
|
|
557cc2198d | ||
|
|
f95aced43b | ||
|
|
24950f97ae | ||
|
|
cb30756f48 | ||
|
|
0868e372e0 | ||
|
|
9d431cfddd | ||
|
|
c937400e8e | ||
|
|
8bea5c552a | ||
|
|
3843578de9 | ||
|
|
be9a066029 | ||
|
|
6f2ba7fcd5 | ||
|
|
d72de26ef9 | ||
|
|
80fae81eee | ||
|
|
91fa6dd5cc | ||
|
|
a6b0c165c4 | ||
|
|
999764cf36 | ||
|
|
0e70fc4044 | ||
|
|
3b703a6379 | ||
|
|
4f27489ccf | ||
|
|
2cfd792d24 | ||
|
|
b406b5df2c | ||
|
|
536b9e8d9d | ||
|
|
8d5685771d | ||
|
|
69a568ae49 | ||
|
|
59d947dcab | ||
|
|
62cb5a2e54 | ||
|
|
cd61aef07d | ||
|
|
afe62e915d | ||
|
|
ef4eeadcd8 | ||
|
|
3da59cef3d | ||
|
|
a0b40be04f | ||
|
|
73fb12b379 | ||
|
|
94d3550844 | ||
|
|
14e7dd3f86 | ||
|
|
dff9746527 | ||
|
|
effd766e3b | ||
|
|
4d94c6b3e3 | ||
|
|
daeb118543 | ||
|
|
c47f458586 | ||
|
|
8c2b84fc31 | ||
|
|
1667f5f2b2 | ||
|
|
e1905168a8 | ||
|
|
10475761cf | ||
|
|
db381cad92 | ||
|
|
bb16473fac | ||
|
|
fe5ca1de96 | ||
|
|
ebccc29d97 | ||
|
|
1a8cd671ab | ||
|
|
d1ba5f5914 | ||
|
|
e402a6a55c | ||
|
|
e612b44ecd | ||
|
|
fc1d3b0719 | ||
|
|
c626c01a5e | ||
|
|
d1ea2f0dc4 | ||
|
|
70a586d4b1 | ||
|
|
9da55e9791 | ||
|
|
6c44b3fcc5 | ||
|
|
b1f34c1620 | ||
|
|
1cfe34f517 | ||
|
|
6c87e069ec | ||
|
|
d658ef364b | ||
|
|
f85dc8cb9a | ||
|
|
cdac86782b | ||
|
|
46615e70db | ||
|
|
6aa3ff1374 | ||
|
|
dce862364b | ||
|
|
ec5a864abb | ||
|
|
d78a2e0361 | ||
|
|
f661da9d47 | ||
|
|
9999815ac8 | ||
|
|
809439e20e | ||
|
|
5b83893476 | ||
|
|
9d154cc41b | ||
|
|
7679003f87 | ||
|
|
cd1bfd87c5 | ||
|
|
45bf76a0fe | ||
|
|
f543c5ad72 | ||
|
|
89a72c27a7 | ||
|
|
314131d003 | ||
|
|
386ebc29f1 | ||
|
|
b0f14de2a4 | ||
|
|
fd8a583020 | ||
|
|
cc2da937c6 | ||
|
|
34e2e800c5 | ||
|
|
26c74ef356 | ||
|
|
e4b3029668 | ||
|
|
b7d4865afd | ||
|
|
d5ab75a14e | ||
|
|
c7475db860 | ||
|
|
83d37b4887 | ||
|
|
2d53ceb8bf | ||
|
|
d107155a57 | ||
|
|
43fb4d16a7 | ||
|
|
6d1f26df05 | ||
|
|
86471ad7e2 | ||
|
|
9dfa5fc675 | ||
|
|
4547dbc0b4 | ||
|
|
7b23335d29 | ||
|
|
da53c35f91 | ||
|
|
edd84eaa72 | ||
|
|
1a75bc845f | ||
|
|
e96f95802d | ||
|
|
aa190ad319 | ||
|
|
3547f16d08 | ||
|
|
da113f9fad | ||
|
|
150ad0b176 | ||
|
|
ba5324d3cd | ||
|
|
631d0501bb | ||
|
|
20ceaf9000 | ||
|
|
a8972c7d70 | ||
|
|
8196cb1c43 | ||
|
|
624eaf3f8a | ||
|
|
4ca311224f | ||
|
|
1fc9d5a4a4 | ||
|
|
7568f0a6f5 | ||
|
|
726a458c84 | ||
|
|
4daaa41211 | ||
|
|
74c973b0d8 | ||
|
|
a8eac11d82 | ||
|
|
e15ac48f0f | ||
|
|
74cb3d417b | ||
|
|
b45bd07bab | ||
|
|
feafa4d027 | ||
|
|
fc08e23f54 | ||
|
|
590234ba13 | ||
|
|
ac123a98de | ||
|
|
cd3ba72b2f |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal 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/']
|
||||||
20
.github/workflows/run-test.yml
vendored
Normal file
20
.github/workflows/run-test.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: ua-parser-js-run-test
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
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
|
||||||
@@ -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
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.22",
|
"version": "1.0.37",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Faisal Salman <f@faisalman.com>"
|
"Faisal Salman <f@faisalman.com>"
|
||||||
],
|
],
|
||||||
|
|||||||
82
changelog.md
Normal file
82
changelog.md
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# UAParser.js Changelog
|
||||||
|
|
||||||
|
# Version 0.7 / 1.0
|
||||||
|
|
||||||
|
Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.
|
||||||
|
|
||||||
|
## Version 0.7.37 / 1.0.37
|
||||||
|
- Fix misidentified WebView token as device model
|
||||||
|
- Increase UA_MAX_LENGTH to 500
|
||||||
|
- Add new browser: Alipay, Klarna, Smart Lenovo Browser, Vivo Browser
|
||||||
|
- Add new device: Ulefone
|
||||||
|
- Improve device detection: Realme, Xiaomi Redmi
|
||||||
|
- Rename browser: Avant, Baidu, Samsung Internet, Sogou Explorer, Sogou Mobile, WeChat
|
||||||
|
|
||||||
|
## Version 0.7.36 / 1.0.36
|
||||||
|
- Add new browser: Snapchat
|
||||||
|
- Add new devices: Infinix, Tecno
|
||||||
|
- Improve device detection: Amazon Fire TV, Xiaomi POCO
|
||||||
|
- Improve OS detection: iOS
|
||||||
|
|
||||||
|
## Version 0.7.35 / 1.0.35
|
||||||
|
- Fix result from user-supplied user-agent being altered
|
||||||
|
- Add new browser: Heytap, TikTok
|
||||||
|
- Add new engine: LibWeb
|
||||||
|
- Add new OS: SerenityOS
|
||||||
|
- Improve browser detection: Yandex
|
||||||
|
- Improve device detection: iPhone, Amazon Echo
|
||||||
|
- Improve OS detection: iOS
|
||||||
|
|
||||||
|
## Version 0.7.34 / 1.0.34
|
||||||
|
- Fix Sharp Mobile detected as Huawei Tablet
|
||||||
|
- Fix IE8 bug
|
||||||
|
- Add new devices : Kobo e-Reader, Apple Watch, and some new SmartTV devices
|
||||||
|
- Add new OS : watchOS
|
||||||
|
- Improve browser detection : Kakao, Naver, Brave
|
||||||
|
- Improve device detection : Oculus, iPad
|
||||||
|
- Improve OS detection : Chrome OS
|
||||||
|
- Using navigator.userAgentData as fallback for device.type & os.name
|
||||||
|
|
||||||
|
## Version 0.7.33 / 1.0.33
|
||||||
|
|
||||||
|
- Add new browser : Cobalt
|
||||||
|
- Identify Macintosh as an Apple device
|
||||||
|
- Fix ReDoS vulnerability
|
||||||
|
|
||||||
|
## Version 0.7.32 / 1.0.32
|
||||||
|
|
||||||
|
- Add new browser : DuckDuckGo, Huawei Browser, LinkedIn
|
||||||
|
- Add new OS : HarmonyOS
|
||||||
|
- Add some Huawei models
|
||||||
|
- Add Sharp Aquos TV
|
||||||
|
- Improve detection Xiaomi Mi CC9
|
||||||
|
- Fix Sony Xperia 1 III misidentified as Acer tablet
|
||||||
|
- Fix Detect Sony BRAVIA as SmartTV
|
||||||
|
- Fix Detect Xiaomi Mi TV as SmartTV
|
||||||
|
- Fix Detect Galaxy Tab S8 as tablet
|
||||||
|
- Fix WeGame mistakenly identified as WeChat
|
||||||
|
- Fix included commas in Safari / Mobile Safari version
|
||||||
|
- Increase UA_MAX_LENGTH to 350
|
||||||
|
|
||||||
|
## Version 0.7.31 / 1.0.2
|
||||||
|
|
||||||
|
- Fix OPPO Reno A5 incorrect detection
|
||||||
|
- Fix TypeError Bug
|
||||||
|
- Use AST to extract regexes and verify them with safe-regex
|
||||||
|
|
||||||
|
## Version 0.7.30 / 1.0.1
|
||||||
|
|
||||||
|
- Add new browser : Obigo, UP.Browser, Klar
|
||||||
|
- Add new device : Oculus, Roku
|
||||||
|
- Add new OS: Maemo, HP-UX, Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
|
||||||
|
- Improve detection for Sony Xperia 1ii, LG Android TV, and some more devices
|
||||||
|
- Improve detection for ARM64 CPU
|
||||||
|
- Improve detection for Windows Mobile, Netscape, Mac on PowerPC
|
||||||
|
- Categorize PDA as mobile
|
||||||
|
- Fix Sharp devices misjudged as Huawei
|
||||||
|
- Fix trailing comma for ES3 compatibility
|
||||||
|
- Some code refactor
|
||||||
|
|
||||||
|
# Version 0.8
|
||||||
|
|
||||||
|
Version 0.8 was created by accident. This version is now deprecated and no longer maintained, please update to version 0.7 / 1.0.
|
||||||
13
dist/ua-parser.min.js
vendored
13
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
13
dist/ua-parser.pack.js
vendored
13
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2012-2019 Faisal Salman <<f@faisalman.com>>
|
Copyright (c) 2012-2023 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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Package.describe({
|
Package.describe({
|
||||||
name: 'faisalman:ua-parser-js',
|
name: 'faisalman:ua-parser-js',
|
||||||
version: '0.7.22',
|
version: '1.0.37',
|
||||||
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'
|
||||||
|
|||||||
106
package.json
106
package.json
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.22",
|
"version": "1.0.37",
|
||||||
"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",
|
||||||
@@ -13,93 +13,150 @@
|
|||||||
"device",
|
"device",
|
||||||
"cpu",
|
"cpu",
|
||||||
"jquery-plugin",
|
"jquery-plugin",
|
||||||
"ecosystem:jquery"
|
"ecosystem:jquery",
|
||||||
|
"ua-parser-js",
|
||||||
|
"client-hints",
|
||||||
|
"user-agent-detection",
|
||||||
|
"device-detection",
|
||||||
|
"platform-detection",
|
||||||
|
"mobile-detection",
|
||||||
|
"browser-detection",
|
||||||
|
"architecture-detection"
|
||||||
],
|
],
|
||||||
"homepage": "http://github.com/faisalman/ua-parser-js",
|
"homepage": "https://github.com/faisalman/ua-parser-js",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Aamir Poonawalla <aamir@urx.com>",
|
"Aamir Poonawalla <aamir@urx.com>",
|
||||||
"Admas <mollases@users.noreply.github.com>",
|
"Admas <mollases@users.noreply.github.com>",
|
||||||
"algenon <m@antonz.ru>",
|
"algenon <m@antonz.ru>",
|
||||||
"Alvin Portillo <portilloalvin@gmail.com>",
|
"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",
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"src"
|
||||||
|
],
|
||||||
"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"
|
||||||
},
|
},
|
||||||
@@ -111,14 +168,17 @@
|
|||||||
],
|
],
|
||||||
"regs": [
|
"regs": [
|
||||||
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
|
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
|
||||||
"^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
|
"^(\\/?\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "~1.1.0",
|
"@babel/parser": "7.15.8",
|
||||||
"mocha": "~1.8.0",
|
"@babel/traverse": "7.15.4",
|
||||||
|
"jshint": "~2.12.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 +196,19 @@
|
|||||||
},
|
},
|
||||||
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
"bugs": "https://github.com/faisalman/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"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/faisalman"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
297
readme.md
297
readme.md
@@ -1,62 +1,145 @@
|
|||||||
|
<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).
|
||||||
|
|
||||||
[](https://travis-ci.org/faisalman/ua-parser-js)
|
|
||||||
[](https://www.npmjs.com/package/ua-parser-js)
|
|
||||||
[](https://www.npmjs.com/package/ua-parser-js)
|
|
||||||
[](https://bower.io/)
|
|
||||||
[](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
|
||||||
|
* Documentation :
|
||||||
|
* v1 : https://github.com/faisalman/ua-parser-js/tree/1.0.35#documentation
|
||||||
|
* v2 : https://faisalman.github.io/ua-parser-js-docs/v2
|
||||||
|
|
||||||
# Constructor
|
***
|
||||||
|
|
||||||
|
### From Our Sponsors:
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<a href="https://opencollective.com/ua-parser-js">↗ Become a sponsor</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
### UAParser([user-agent][,extensions])
|
||||||
|
typeof `user-agent` "string".
|
||||||
|
|
||||||
|
typeof `extensions` "array".
|
||||||
|
|
||||||
|
In The Browser environment you dont need to pass the user-agent string to the function, you can just call the funtion and it should automatically get the string from the `window.navigator.userAgent`, but that is not the case in nodejs. The user-agent string must be passed in nodejs for the function to work.
|
||||||
|
Usually you can find the user agent in:
|
||||||
|
`request.headers["user-agent"]`.
|
||||||
|
|
||||||
|
|
||||||
|
## Constructor
|
||||||
|
When you call `UAParser` with the `new` keyword `UAParser` will return a new instance with an empty result object, you have to call one of the available methods to get the information from the user-agent string.
|
||||||
|
Like so:
|
||||||
* `new UAParser([uastring][,extensions])`
|
* `new UAParser([uastring][,extensions])`
|
||||||
* returns new instance
|
```js
|
||||||
|
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
|
||||||
|
console.log(parser); // {}
|
||||||
|
let parserResults = parser.getResult();
|
||||||
|
console.log(parserResults);
|
||||||
|
/** {
|
||||||
|
"ua": "",
|
||||||
|
"browser": {},
|
||||||
|
"engine": {},
|
||||||
|
"os": {},
|
||||||
|
"device": {},
|
||||||
|
"cpu": {}
|
||||||
|
} */
|
||||||
|
```
|
||||||
|
|
||||||
|
When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
|
||||||
* `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
|
||||||
|
|
||||||
|
#### Methods table
|
||||||
|
The methods are self explanatory, here's a small overview on all the available methods:
|
||||||
|
* `getResult()` - returns all function object calls, user-agent string, browser info, cpu, device, engine, os:
|
||||||
|
`{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`.
|
||||||
|
|
||||||
|
* `getBrowser()` - returns the browser name and version.
|
||||||
|
* `getDevice()` - returns the device model, type, vendor.
|
||||||
|
* `getEngine()` - returns the current browser engine name and version.
|
||||||
|
* `getOS()` - returns the running operating system name and version.
|
||||||
|
* `getCPU()` - returns CPU architectural design name.
|
||||||
|
* `getUA()` - returns the user-agent string.
|
||||||
|
* `setUA(user-agent)` - set a custom user-agent to be parsed.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
* `getResult()`
|
||||||
|
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||||
|
|
||||||
* `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, Alipay, Amaya, Android Browser, Arora, Avant, Avast,
|
||||||
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
|
AVG, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
|
||||||
Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
|
Chrome Headless, Chrome WebView, Chrome, Chromium, Cobalt, Comodo Dragon, Dillo,
|
||||||
Dolphin, Doris, Edge, Epiphany, Facebook, Falkon, Fennec, Firebird, Firefox,
|
Dolphin, Doris, DuckDuckGo, Edge, Electron, Epiphany, Facebook, Falkon, Fennec,
|
||||||
Flock, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon,
|
Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Heytap,
|
||||||
Iceape, Iceweasel, Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror,
|
Huawei Browser, iCab, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon,
|
||||||
LBBROWSER Line, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo,
|
Iceweasel, Instagram, Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon,
|
||||||
Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront,
|
Kindle, Klar, Klarna, Konqueror, LBBROWSER, Line, LinkedIn, Links, Lunascape,
|
||||||
NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser, OmniWeb,
|
Lynx, MIUI Browser, Maemo, Maxthon, Midori, Minimo, Mobile Safari, Mosaic,
|
||||||
Opera Coast, Opera Mini, Opera Mobi, Opera Tablet, Opera, PaleMoon, PhantomJS,
|
Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo,
|
||||||
Phoenix, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla,
|
Oculus Browser, OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon,
|
||||||
RockMelt, Safari, Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire,
|
PhantomJS, Phoenix, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark,
|
||||||
Sleipnir, Slim, SlimBrowser, Swiftfox, Tizen Browser, UCBrowser, Vivaldi,
|
QupZilla, RockMelt, Safari, Sailfish Browser, Samsung Internet, SeaMonkey, Silk,
|
||||||
Waterfox, WeChat, Yandex, baidu, iCab, w3m, ...
|
Skyfire, Sleipnir, Slim, SlimBrowser, Smart Lenovo Browser, Snapchat,
|
||||||
|
Sogou [Explorer/Mobile], Swiftfox, Tesla, TikTok, Tizen Browser, UCBrowser,
|
||||||
|
UP.Browser, Viera, Vivaldi, Vivo Browser, Waterfox, WeChat, Weibo, Yandex, 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
|
||||||
|
|
||||||
|
##########
|
||||||
|
# NOTE: 'desktop' is not a possible device type.
|
||||||
|
# UAParser only reports info directly available from the UA string, which is not the case for 'desktop' device type.
|
||||||
|
# If you wish to detect desktop devices, you must handle the needed logic yourself.
|
||||||
|
# You can read more about it in this issue: https://github.com/faisalman/ua-parser-js/issues/182
|
||||||
|
##########
|
||||||
|
|
||||||
# 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, Facebook, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Infinix,
|
||||||
Nexian, Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron,
|
Jolla, Kobo, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia,
|
||||||
RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ...
|
Nvidia, OnePlus, OPPO, Ouya, Palm, Panasonic, Pebble, Polytron, Realme, RIM,
|
||||||
|
Roku, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Tecno, Tesla, Ulefone,
|
||||||
|
Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
|
||||||
|
|
||||||
# 'device.model' determined dynamically
|
# 'device.model' determined dynamically
|
||||||
```
|
```
|
||||||
@@ -66,8 +149,8 @@ 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, LibWeb, Links, Lynx,
|
||||||
NetSurf, Presto, Tasman, Trident, w3m, WebKit
|
NetFront, NetSurf, Presto, Tasman, Trident, w3m, WebKit
|
||||||
|
|
||||||
# 'engine.version' determined dynamically
|
# 'engine.version' determined dynamically
|
||||||
```
|
```
|
||||||
@@ -77,13 +160,15 @@ 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, HarmonyOS, HP-UX, Hurd, iOS, Joli, KaiOS,
|
||||||
Minix, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD,
|
Linpus, Linspire,Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix,
|
||||||
PCLinuxOS, Plan9, Playstation, QNX, RedHat, RIM Tablet OS, RISC OS, Sailfish,
|
Mint, Morph OS, NetBSD, NetRange, NetTV, Nintendo, OpenBSD, OpenVMS, OS/2, Palm,
|
||||||
Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux,
|
PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS,
|
||||||
WebOS, Windows [Phone/Mobile], Zenwalk, ...
|
RISC OS, Sabayon, Sailfish, SerenityOS, Series40, Slackware, Solaris, SUSE,
|
||||||
|
Symbian, Tizen, Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS,
|
||||||
|
Windows [Phone/Mobile], Zenwalk, ...
|
||||||
|
|
||||||
# 'os.version' determined dynamically
|
# 'os.version' determined dynamically
|
||||||
```
|
```
|
||||||
@@ -93,21 +178,20 @@ 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()`
|
|
||||||
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
|
||||||
|
|
||||||
* `getUA()`
|
* `getUA()`
|
||||||
* 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 +201,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 +229,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 +245,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}
|
||||||
@@ -182,6 +265,8 @@ WebOS, Windows [Phone/Mobile], Zenwalk, ...
|
|||||||
|
|
||||||
## Using node.js
|
## Using node.js
|
||||||
|
|
||||||
|
Note: Device information is not available in the NodeJS environment.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm install ua-parser-js
|
$ npm install ua-parser-js
|
||||||
```
|
```
|
||||||
@@ -201,40 +286,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 +296,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 +321,50 @@ 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
|
## Backers & Sponsors
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/organizations.svg?avatarHeight=64"></a>
|
||||||
|
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/individuals.svg?avatarHeight=64"></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 don’t find a way to show some love? If yes, please consider donating to support this project. Otherwise, no worries, regardless of whether there is support or not, I will keep maintaining this project. Still, if you buy me a cup of coffee I would be more than happy though :)
|
|
||||||
|
|
||||||
[](https://www.paypal.me/faisalman/)
|
|
||||||
|
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
5
security.md
Normal file
5
security.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Please report security issues to `f@faisalman.com`
|
||||||
1204
src/ua-parser.js
1204
src/ua-parser.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,46 @@
|
|||||||
"architecture" : "amd64"
|
"architecture" : "amd64"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Vivaldi on Windows",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Vivaldi on Windows",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Vivaldi on Linux",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Vivaldi on Linux",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ia32"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "Xiaomi POCO M2 Pro",
|
||||||
|
"ua": "Mozilla/5.0 (Linux; arm_64; Android 11; POCO M2 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 YaBrowser/22.11.7.42.00 SA/3 Mobile Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "arm64"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "win64",
|
"desc" : "win64",
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
||||||
@@ -40,7 +80,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 +97,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 +199,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 +215,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 +238,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
@@ -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",
|
||||||
@@ -44,6 +53,15 @@
|
|||||||
"version" : "4.5.4"
|
"version" : "4.5.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LibWeb",
|
||||||
|
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "LibWeb",
|
||||||
|
"version" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "NetFront",
|
"desc" : "NetFront",
|
||||||
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
||||||
@@ -97,5 +115,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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
1006
test/os-test.json
1006
test/os-test.json
File diff suppressed because it is too large
Load Diff
77
test/test.js
77
test/test.js
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user