Compare commits

...

755 Commits

Author SHA1 Message Date
Faisal Salman
44d9d5700f Update 2.0.0-beta.3-pro-business 2024-07-24 13:48:45 +07:00
Faisal Salman
99d59f7e4c Update 2.0.0-beta.3-pro-personal
Merge with 2.0.0-beta.2-pro-personal
2024-07-24 12:59:09 +07:00
Faisal Salman
768b622603 Make it personal - 2.0.0-beta.3-pro-personal 2024-07-24 12:47:58 +07:00
Faisal Salman
5328642e18 Update version to 2.0.0-beta.3 2024-06-08 01:17:52 +07:00
Faisal Salman
bdcd927304 Update test for extensions 2024-06-08 00:27:28 +07:00
Faisal Salman
db3423a76c BREAKING - Remove bot type, divide as crawler / fetcher
Add new crawler: Baiduspider, DuckDuckBot, & Sogou Web Spider
Add new fetcher: Mastodon, Pinterestbot, Redditbot, LinkedInBot, Discordbot, Telegrambot, Twitterbot, Snapchat Bot, WhatsApp
2024-06-08 00:06:27 +07:00
Faisal Salman
173325faa1 Add some well-known bot user-agents: Applebot, Amazonbot, Bytespider, Claudebot, Yandexbot 2024-06-06 22:36:15 +07:00
Faisal Salman
5190905df8 Clean up & few changes related to browser.type 2024-06-06 21:52:16 +07:00
Faisal Salman
0a46ac396a Fix #718 - Extension param now accept multiple extensions 2024-06-06 20:25:43 +07:00
Faisal Salman
f7810dbfcf Add new browsers: Wolvic & Pico Browser 2024-06-06 14:32:59 +07:00
Faisal Salman
0543b87c02 BREAKING CHANGE: AR/VR devices moved to new device type: xr 2024-06-05 15:49:07 +07:00
Faisal Salman
39590f112d BREAKING CHANGE - Add new property to browser: type 2024-06-02 23:04:25 +07:00
Faisal Salman
1a22c6951f Update all package references in /test to use current working directories 2024-06-02 22:39:33 +07:00
Faisal Salman
8991d34e56 Update formFactor -> formFactors, in accordance to the latest change in client hints spec 2024-06-02 21:56:36 +07:00
Faisal Salman
1a2ef00509 Improve browser detection for QQBrowser 2024-06-02 15:49:27 +07:00
Faisal Salman
12c2c2e48a Improve browser detection for Rekonq 2024-06-02 15:35:33 +07:00
Faisal Salman
85bf7076d3 Improve browser detection for ICEBrowser 2024-06-02 15:32:41 +07:00
Faisal Salman
1fa3d02594 Remove Viera from list of browsers 2024-06-02 15:20:50 +07:00
Faisal Salman
4cd867a36e Improve browser detection for Klar
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#klar_for_android
2024-06-02 15:14:42 +07:00
Faisal Salman
6b6fcc68f5 Improve browser detection for Sleipnir 2024-06-02 15:10:37 +07:00
Faisal Salman
760e85bbe7 Update test for some missing browsers:
Blazer, Comodo Dragon, Conkeror, Go Browser, Iron, Jasmine, Links, NetSurf, OviBrowser, Quark, Rekonq, w3m
2024-06-02 15:03:27 +07:00
Faisal Salman
5a8ce35054 Insert spaces to command line output for readability 2024-06-02 10:38:24 +07:00
Faisal Salman
150d3c6b4a Add new feature: parse user-agent in CLI using npx ua-parser-js "[INSERT-UA-HERE]" and print the result in JSON format 2024-06-01 17:59:58 +07:00
Faisal Salman
e87c794fd9 Fix #730 - Improve browser detection: DuckDuckGo 2024-05-23 18:14:23 +07:00
Faisal Salman
d0db40c290 Fix #722 - Add new browser name: Twitter 2024-05-17 23:02:01 +07:00
Faisal Salman
8dce4cc514 Fix #721 - Improve detection: recognize OPPO Pad as tablet 2024-05-17 22:39:11 +07:00
Dai Jie
a43d659577 Fix #710: Add type to IBrowser (#711) 2024-03-19 21:32:43 +07:00
Faisal Salman
b29a9a7ffb Fix #708 - Improve detection for Quest 3 2024-02-28 10:19:30 +07:00
Faisal Salman
6f02da06e0 Make it personal - 2.0.0-beta.2 2024-02-01 12:08:56 +07:00
Faisal Salman
23dc320be4 Make it biz - 2.0.0-beta.2 2024-02-01 12:08:38 +07:00
Faisal Salman
8852b03739 Make it personal 2024-02-01 11:45:23 +07:00
Faisal Salman
4d950db145 Update version to 2.0.0-beta.2 2024-01-28 22:34:46 +07:00
Faisal Salman
b5b5475ab4 Add new helper method: isFrozenUA() to match with frozen user-agent pattern 2024-01-25 12:21:17 +07:00
Faisal Salman
7c22bc587f Fix #703 - Improve TS module resolution --revert 2024-01-25 11:30:10 +07:00
Faisal Salman
d6d8ac7cb4 Fix #692 - Improve TS module resolution (#702) 2024-01-24 09:56:23 +07:00
Beat YT
54c633aac5 Update ua-parser.js (#696)
Fixed Xbox Detection for Chrome-Based Edge
2024-01-24 09:24:38 +07:00
Faisal Salman
9c5d6ee70e Fix Edge detection in ua-ch: "Microsoft Edge" -> "Edge" 2024-01-18 11:29:46 +07:00
Faisal Salman
b5c62b0c82 Fix #635 - ua-ch: prioritize more specific brand name regardless the order 2024-01-10 17:16:26 +07:00
Faisal Salman
0c49d75074 Fix #697 - Add new browser: Opera GX - https://www.opera.com/gx 2023-12-29 20:59:44 +07:00
Faisal Salman
09904a0a47 Fix undefined brandName when reading a field list that has no version 2023-12-20 22:28:23 +07:00
Faisal Salman
3622b614a7 Fix d.ts Record for extensions as Partial 2023-11-30 11:50:44 +07:00
Faisal Salman
e4f2463849 Create declaration file .d.ts for extensions submodule 2023-11-30 11:27:54 +07:00
dependabot[bot]
fdbeabbaed Bump axios from 1.3.6 to 1.6.1 (#689)
Bumps [axios](https://github.com/axios/axios) from 1.3.6 to 1.6.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.3.6...v1.6.1)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-30 10:47:35 +07:00
dependabot[bot]
2046fe5209 Bump @babel/traverse from 7.15.4 to 7.23.2 (#684)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.15.4 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-30 10:46:31 +07:00
Faisal Salman
5173a5442f Update readme for clarity over license options 2023-11-23 12:03:53 +07:00
Faisal Salman
106d882fba Create test for helpers 2023-11-10 10:10:38 +07:00
Faisal Salman
7abc8b9ecc Add new helper method isChromiumBased() to check whether the current browser is a Chromium-based browser 2023-11-09 13:50:04 +07:00
Faisal Salman
7ad3e3b451 Internal refactor: new helper methods to check for string & window 2023-11-09 13:50:04 +07:00
Danila Rodichkin
26f7e7d59e Add "types" inside "exports" of package.json, fix ./helpers import typo (#688) 2023-11-06 14:05:06 +07:00
Faisal Salman
f8f71c65d4 Add new helpers submodule 2023-10-24 11:17:32 +07:00
Faisal Salman
17f0c1e1cd Improve browser detection: WeChat 2023-10-24 00:09:53 +07:00
Faisal Salman
9cc274fb6f Improve browser detection: unified name for Baidu 2023-10-24 00:00:38 +07:00
Faisal Salman
f56073bb3e Improve browser detection: remove unnecessary extra space in "Avant " 2023-10-23 23:33:04 +07:00
Faisal Salman
5c10e2b107 Improve browser detection: rename "Samsung Browser" to "Samsung Internet" https://developer.samsung.com/internet/user-agent-string-format.html 2023-10-23 23:32:35 +07:00
Faisal Salman
46ff3df974 Update readme 2023-10-19 23:22:31 +07:00
Faisal Salman
cfc01470b5 Update enums 2023-10-19 23:21:33 +07:00
Faisal Salman
d565f65280 Fix #682 - Add new browser: Smart Lenovo Browser
https://browser.lenovo.com.cn/
2023-10-19 10:05:52 +07:00
Faisal Salman
69ed6cec77 Fix #683 - change MetaSr into Sogou Explorer (+add Sogou Mobile) 2023-10-12 22:11:20 +07:00
Faisal Salman
b51ae9eb38 Fix misidentified WebView token as device model - found in #681 2023-10-12 14:52:25 +07:00
Faisal Salman
125f0d9f16 Fix #681 - Add new browser: Vivo Browser
https://play.google.com/store/apps/details?id=com.vivo.browser
2023-10-12 14:43:26 +07:00
Faisal Salman
e614108911 Increase UA_MAX_LENGTH to 500 2023-10-12 14:36:54 +07:00
Faisal Salman
77e0aa1ac6 Fix #563 #631 - Add new browser: Alipay 2023-10-12 14:18:51 +07:00
Faisal Salman
119515edd2 Update readme: comparison between versions & licenses 2023-10-10 14:14:12 +07:00
Faisal Salman
c8c6d121e0 Add PULL_REQUEST_TEMPLATE.md 2023-10-10 11:45:43 +07:00
Faisal Salman
1d776d469b Make it biz 2023-10-05 22:08:02 +07:00
Faisal Salman
e6a085f710 Fix failed CI tests 2023-10-05 20:05:27 +07:00
Faisal Salman
37c61736c3 Make it personal 2023-10-05 19:27:42 +07:00
Ilya Daraseliya
177a496c34 add Klarna Shopping Browser UA parser (#669)
Co-authored-by: Ilya Daraseliya <ilya.daraseliya@klarna.com>
2023-10-02 18:54:37 +07:00
Faisal Salman
ac282df13e Update version to 2.0.0-beta.1 2023-10-02 15:11:31 +07:00
Faisal Salman
5a0d9cc3d0 Fix #655 - Provide in-package type definitions 2023-10-02 14:54:32 +07:00
Faisal Salman
f6fbf170e3 Update formFactor to be a list 2023-09-30 16:05:32 +07:00
Faisal Salman
a9247154e0 Update build & test 2023-09-30 14:13:45 +07:00
Faisal Salman
f57f8fa1a7 Update enums & extensions 2023-09-30 14:10:53 +07:00
Faisal Salman
8fea17f296 Update readme & changelog 2023-09-29 23:42:37 +07:00
Faisal Salman
a4b4e8a2c2 Update issue templates 2023-09-29 08:37:39 +07:00
Faisal Salman
954ce35755 Add CONTRIBUTING.md - general instruction for contributors 2023-09-29 08:26:40 +07:00
Faisal Salman
ea4f145e64 Add pull_request_template.md 2023-09-29 08:26:40 +07:00
Hyunbin
91d2d2c0e8 fix: changelog link in readme (#672) 2023-09-27 08:07:46 +07:00
Faisal Salman
b5546ee39f Breaking change: switch license to AGPLv3 2023-09-26 11:35:14 +07:00
Faisal Salman
b3f4321bb6 Modify issue template: bug report should include library version 2023-09-18 09:48:32 +07:00
Faisal Salman
aa76da90d9 Fix #651 - Improve device detection: Xiaomi Redmi 2023-09-18 00:31:46 +07:00
Faisal Salman
817c5835ef Add new device vendor: Ulefone
https://ulefone.com/
https://www.gsmarena.com/ulefone-phones-124.php
2023-09-18 00:11:46 +07:00
Faisal Salman
6ea6936632 Improve device detection: Realme 2023-09-18 00:09:51 +07:00
Faisal Salman
9b182526fa Rename markdown files to uppercase 2023-09-18 00:07:17 +07:00
Faisal Salman
f17d2d7664 Add CODE OF CONDUCT 2023-09-17 21:55:14 +07:00
Faisal Salman
9652169da0 Update changelog 2023-09-16 20:55:02 +07:00
Faisal Salman
bf1d7267f6 Update contributors 2023-09-16 17:56:50 +07:00
Faisal Salman
5226361348 Remove sub-packages since they've been moved to their own dedicated repo
https://github.com/faisalman/ua-client-hints-js
https://github.com/faisalman/gpu-detect-js
https://github.com/faisalman/ua-is-frozen
https://github.com/faisalman/re-parse-js
2023-09-09 19:35:52 +07:00
Faisal Salman
385e0aaee5 Regenerate lockfile 2023-09-04 22:42:52 +07:00
Faisal Salman
a661ab61d5 [ua-client-hints] update test file 2023-09-04 22:41:58 +07:00
Faisal Salman
647e115a1e [ua-helpers] Fix type error 2023-09-04 22:41:44 +07:00
Faisal Salman
05a98aceda Add new package: gpu-detect to obtain GPU info from user-agent 2023-09-03 11:07:09 +07:00
Faisal Salman
807dcdbded Add eslint to devDependencies to support latest ES version 2023-08-30 12:56:59 +07:00
Faisal Salman
1522691426 [ua-client-hints] Refactor UAClientHints 2023-08-27 10:53:26 +07:00
Faisal Salman
f538018f8e Update package.json/package-lock.json & remove bower.json (at last!) 2023-08-24 21:12:06 +07:00
Faisal Salman
3f105fe93b [helpers] split helpers into 2 new packages: user-agent-helpers & client-hints-helpers 2023-08-23 14:53:34 +07:00
Faisal Salman
129657673b [helpers] Add new method: UACHParser(), parse client-hints HTTP headers into its JS API equivalent 2023-08-22 23:58:04 +07:00
Faisal Salman
3dd4b60ee9 [helpers] Add new method: unfreezeUA(), construct new unfreezed user-agent string using real data from client hints 2023-08-22 01:16:09 +07:00
Faisal Salman
73a936001a Modify ua-parser-js/helpers submodule into @ua-parser-js/helpers scoped package 2023-08-21 11:28:30 +07:00
Faisal Salman
2046b77ede Improve device.type detection using client hints "form-factor" data 2023-08-20 13:59:44 +07:00
Faisal Salman
d168b75a3a Bump version 2.0.0-alpha.3 2023-08-17 11:29:18 +07:00
Faisal Salman
6e26e38247 [extension] Add Axios, jsdom, Scrapy. Also fixes #627 #156 #217 #227
Axios: `axios/VERSION`
https://www.zenrows.com/blog/axios-user-agent#what-is-axios-user-agent

JSDOM: `Mozilla/5.0 (${process.platform || "unknown OS"}) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/${jsdomVersion}`
https://github.com/jsdom/jsdom

Scrapy: `Scrapy/VERSION (+https://scrapy.org)`
https://docs.scrapy.org/en/master/topics/settings.html
2023-08-15 11:46:31 +07:00
chenyuan-new
3cb567c154 fix: remove duplicated BRANDS input when call setProps in UACHData func (#663) 2023-08-15 11:46:31 +07:00
Runar Heggset
f76d8983ca Fix Amazon Fire TV device detection 2023-08-15 11:46:31 +07:00
Faisal Salman
22eae9f70c [extensions] Add GPTBot to Bots 2023-08-07 21:39:21 +07:00
Faisal Salman
f2e4b242ce Update sponsors section in readme 2023-08-07 21:35:46 +07:00
JBYoshi
153831d2ed Add Snapchat user agent. 2023-07-30 09:11:19 +07:00
Faisal Salman
072a82b87b Add a new submodule: ua-parser-helpers with a method: isFrozenUA() to match a string with a frozen user-agent pattern 2023-05-27 20:53:45 +07:00
Faisal Salman
15d17e97a1 Add some tests; Add new devices: Infinix, Tecno; Improve detection: Xiaomi POCO
Source: https://www.useragents.me
2023-05-06 21:21:21 +07:00
Faisal Salman
df9144b493 Modify test scripts 2023-05-06 19:53:51 +07:00
Faisal Salman
a519d2b879 Add new Action: publish to NPM 2023-04-28 08:01:18 +07:00
Faisal Salman
102dc51683 Update fuzzing test 2023-04-28 06:43:17 +07:00
Faisal Salman
1a806453f9 Merge branch 'develop' 2023-04-27 10:41:49 +07:00
Faisal Salman
3d5c70457e Fuzz testing using Jazzer.js 2023-04-27 09:34:49 +07:00
Faisal Salman
a74ebeb82e Only allow string for setUA() 2023-04-26 13:53:29 +07:00
Faisal Salman
4c77c5ef21 Revive the extensive list of MediaPlayers regexes by @leofiore as an Extension
(Original commit reference: 3fa1fe9f70)
2023-04-24 14:58:08 +07:00
Faisal Salman
9102871dea Rearrange the structure of src folders 2023-04-21 09:47:51 +07:00
Faisal Salman
1653d376ca Update issue templates 2023-04-15 13:45:31 +07:00
Faisal Salman
29fb85658a Fix #643 - Improve iOS detection + detect Slack (&Slackbot) 2023-04-15 01:08:46 +07:00
Faisal Salman
c3be7326b8 Update GitHub package action - change trigger to 'published' 2023-04-15 00:01:49 +07:00
Faisal Salman
5a26ac146e Create build+test scripts 2023-04-15 00:01:49 +07:00
Faisal Salman
35c2b91534 Fix: accept empty string as input 2023-04-15 00:01:49 +07:00
dependabot[bot]
feefb81cd0 Bump shelljs and jshint
Removes [shelljs](https://github.com/shelljs/shelljs). It's no longer used after updating ancestor dependency [jshint](https://github.com/jshint/jshint). These dependencies need to be updated together.


Removes `shelljs`

Updates `jshint` from 2.12.0 to 2.13.6
- [Release notes](https://github.com/jshint/jshint/releases)
- [Changelog](https://github.com/jshint/jshint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jshint/jshint/compare/2.12.0...2.13.6)

---
updated-dependencies:
- dependency-name: shelljs
  dependency-type: indirect
- dependency-name: jshint
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-13 07:31:42 +07:00
Faisal Salman
0ac5028137 Rename workflows for clarity 2023-04-13 07:07:34 +07:00
Faisal Salman
1b17315935 Create action to review dependencies from PR 2023-04-13 06:56:27 +07:00
Faisal Salman
f92bb9ef65 Insert scorecard badge & documentation link 2023-04-13 06:38:15 +07:00
Faisal Salman
f659659500 Set CodeQL permission to read-only 2023-04-13 06:24:11 +07:00
Faisal Salman
6c58ac39cd Update security policy 2023-04-13 06:16:01 +07:00
Faisal Salman
432a2ee72d Pin dependency hash with lockfile & test with lockfile-lint 2023-04-13 06:16:01 +07:00
Faisal Salman
c2f17004b8 Add GitHub's CodeQL Action for static code analysis 2023-04-13 06:08:52 +07:00
Faisal Salman
f5af76a2b3 Create GitHub packaging workflow 2023-04-12 13:16:41 +07:00
Faisal Salman
99baf60d50 Fix #608 - Add OpenSSF Scorecard GitHub Action 2023-04-12 11:48:00 +07:00
Faisal Salman
46f38adb83 Remove deploy-docs.yml - Move docs to another repo 2023-04-11 23:06:51 +07:00
Faisal Salman
ff26813708 Update deploy-docs.yml - again 2023-04-11 11:26:11 +07:00
Faisal Salman
e62cded083 Update deploy-docs.yml 2023-04-11 11:24:11 +07:00
Faisal Salman
2fb0c72898 Create deploy-docs.yml 2023-04-11 10:59:46 +07:00
Faisal Salman
801c2409b3 Update readme & IData explanations 2023-04-09 15:54:46 +07:00
Faisal Salman
a8951ec282 Update actions to remove cache 2023-04-09 10:21:20 +07:00
Faisal Salman
07c9e36ebe Update actions to install playwright & run build before test 2023-04-09 10:13:08 +07:00
Faisal Salman
407b23262c Update actions to v3 2023-04-09 09:04:48 +07:00
Faisal Salman
16b416d9ea Move feature detection into its own method: withFeatureCheck 2023-04-09 07:40:21 +07:00
Faisal Salman
05747dba37 Install @playwright/test to perform test in real browser 2023-04-08 09:33:17 +07:00
Faisal Salman
625ece73e2 Rearrange test files & config 2023-04-08 07:12:18 +07:00
Faisal Salman
e01663b48f Rearrange internal class & remove old Safari map 2023-04-08 04:40:59 +07:00
Faisal Salman
59d8d836c2 Clean up: remove travis, verup; move jshint config to inline 2023-04-06 05:48:14 +07:00
Faisal Salman
b385a73340 Move feature detection to its own dedicated method 2023-04-05 23:29:27 +07:00
Faisal Salman
4711805a1c Re-use previous result instead of re-parse it all over again 2023-04-05 22:28:35 +07:00
Faisal Salman
5d2acd8fe7 Bump version 2.0.0-alpha.2 2023-04-02 18:00:48 +07:00
Faisal Salman
359cbecd32 Fix #640 - Self-return thenable causing infinite-loop when awaited 2023-04-02 05:55:33 +07:00
Faisal Salman
1e80cf3533 Only set browser as Chromium if no other brand was found 2023-03-29 23:42:30 +07:00
Faisal Salman
b09878934f Prevent altering the result when supplied user-agent is different from current user-agent 2023-03-29 22:53:07 +07:00
Faisal Salman
30de983043 Alpha release of v2.0 2023-03-29 10:44:37 +07:00
Faisal Salman
894512c72f Move some low-usage devices to extension as ExtraDevices 2023-03-29 10:14:20 +07:00
Faisal Salman
4af26c7a5e Add new browser: TikTok
User-agent example:
- https://user-agents.net/s/o2A0qRAZIN
- https://explore.whatismybrowser.com/useragents/parse/241240920-android-webview-android-jny-l22-blink
2023-03-29 05:58:44 +07:00
Faisal Salman
a6c85d0148 Add new engine: LibWeb + Add new OS: SerenityOS 2023-03-29 04:52:26 +07:00
Faisal Salman
7a4fe6f454 Fix #227 #237 #488 : Provide extensions - initial work 2023-03-28 10:41:59 +07:00
Faisal Salman
af65fd6960 Fix #300 : Provide enums - initial work 2023-03-28 08:36:48 +07:00
Faisal Salman
ba28d33d51 Move generated .mjs file to /src 2023-03-27 22:37:42 +07:00
Faisal Salman
82567c28ab Fix #639: Only check for Brave properties if given userAgent match the current userAgent 2023-03-26 12:46:04 +07:00
Faisal Salman
e70d09a1f8 Fix #489: ARM arch detection & create test that simulates HTTP headers sent from an Apple silicon 2023-03-25 07:21:17 +07:00
Faisal Salman
3af8e1e272 Upon creating new item, only pass regex map thats relevant with its itemType 2023-03-23 21:43:19 +07:00
Faisal Salman
172f57ffea Fix #636 - Add new browser: HeyTap | Fix #248 - Add 'Mobile' prefix for mobile version of Chrome, Firefox, Safari 2023-03-22 11:51:28 +07:00
Faisal Salman
33f02099d1 Fix #678 - Improve Yandex detection 2023-03-22 11:18:52 +07:00
Faisal Salman
33df5dc698 Fix #637 - Detect Safari on iPhone as Safari Mobile 2023-03-22 11:02:26 +07:00
Faisal Salman
49d6422ebd Mistype in iPad detection 2023-03-22 10:53:15 +07:00
Faisal Salman
a1d816ae21 Fix #519 #521 #616 - Improve iPhone & iOS detection 2023-03-20 23:37:19 +07:00
Faisal Salman
0097b211db Merge branch 'shaharmor-mobile-browsers' into develop 2023-03-20 11:08:31 +07:00
Faisal Salman
6b3fc3e0f1 Small refactor 2023-03-20 11:05:42 +07:00
Faisal Salman
08436ce4f5 Merge branch 'mobile-browsers' of https://github.com/shaharmor/ua-parser-js 2023-03-19 11:05:25 +07:00
Faisal Salman
df1a1c7bb4 Fix #624 - Detect Amazon Echo 2023-03-18 18:50:42 +07:00
Faisal Salman
31f94f3a51 Fix #441 #591 - Generate ESM version of main CJS file at build time 2023-03-18 17:41:42 +07:00
Faisal Salman
6821276669 Fix #218 #491 #517 #518 - introduce breaking changes: "Mac OS" => "macOS", "Chromium OS" => "Chrome OS" 2023-03-18 16:39:01 +07:00
Faisal Salman
41f8d76968 Remove is() & toString() prototype from getResult() data 2023-03-18 10:38:38 +07:00
Faisal Salman
c78346d3b4 Returns withClientHints() as Thenable in nodejs / non-client-hints browsers 2023-03-15 23:37:41 +07:00
Faisal Salman
f8dde65d54 Only use user-agent data by default. Must explicitly call withClientHints() to also use client-hints data 2023-03-14 23:22:26 +07:00
Faisal Salman
60d3a2fbbc Create test for client hints in browser context 2023-03-12 16:31:58 +07:00
Faisal Salman
aff5a209f8 Add new method: withClientHints() #408 #566 #588 2023-03-11 20:32:35 +07:00
Faisal Salman
5672a2e15c Expose UA-CH data in getResult() 2023-03-10 22:15:12 +07:00
Faisal Salman
3c3c03ceeb Add new feature: read Client Hints data from HTTP Headers #408 #566 #588 2023-03-08 22:42:59 +07:00
Faisal Salman
d99ff741f4 Add new feature: ability to pass req.headers object directly into UAParser 2023-02-28 17:58:46 +07:00
Faisal Salman
9ee128ae2b Fix failing CI test, update funding & license year 2023-02-28 12:26:21 +07:00
Faisal Salman
c6b4c867d5 Sponsorship content revision 2023-02-28 01:13:56 +07:00
Faisal Salman
f1449a8202 Refactor 2023-02-27 23:14:43 +07:00
Faisal Salman
18730452f2 Add new device: Apple Watch, new os: watchOS 2023-02-25 11:41:19 +07:00
Faisal Salman
5ea9f0ec16 Fix #387 #554 - Detect iPadOS 13
https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
2023-02-24 14:31:21 +07:00
Faisal Salman
03b0a5afa6 Fix #498 - Detect Brave Browser by checking navigator.brave
https://github.com/brave/brave-browser/issues/10165#issuecomment-641128278
2023-02-24 13:13:03 +07:00
Faisal Salman
d03c74d6b7 Insert sponsorship content from 51degrees 2023-02-21 22:57:17 +07:00
Faisal Salman
f18516c9c8 Make sure all properties are "undefined" for is("undefined") to be true 2023-02-19 16:43:59 +07:00
Faisal Salman
746ac28f94 Readme: update is() & toString() methods explanation 2023-02-19 16:33:46 +07:00
Faisal Salman
96fb3a5ed5 Merge branch 'is-utility' 2023-02-19 09:30:07 +07:00
Faisal Salman
6c34c3d4fa Add new utility methods: is() & toString() 2023-02-18 20:46:28 +07:00
Faisal Salman
f8e5a1fb4f Fix #601 - Detect Chrome OS without version 2023-01-31 15:09:14 +07:00
Faisal Salman
c9d1ab9561 Merge branch 'develop' 2023-01-28 21:04:43 +07:00
Faisal Salman
f815ca6e9c Fix #620 - Add new Device: Kobo 2023-01-26 14:58:53 +07:00
Faisal Salman
0cbeb7a829 Rearrange the recently added smarttv detection 2023-01-26 14:08:18 +07:00
Faisal Salman
bf4fb916ca Merge pull request #618 from garritfra/smarttv
Support for various smart tvs
2023-01-26 10:52:47 +07:00
Faisal Salman
68447d883a Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2023-01-26 10:28:34 +07:00
Faisal Salman
0b0c7ff617 Fix #619 - Move Sharp up to be checked before Huawei 2023-01-26 10:26:38 +07:00
Faisal Salman
5b2e80bdfd Merge pull request #527 from jparismorgan/samsung
Add Samsung Galaxy S20 5G
2023-01-26 10:00:29 +07:00
Faisal Salman
ba0f25c19d Improve Kakao/Naver detection + add test 2023-01-26 09:36:41 +07:00
Faisal Salman
4d3048aaaa Merge pull request #573 from KnifeLemon/patch-1
Add KakaoTalk App, KakaoStory App regex
2023-01-26 08:53:26 +07:00
Faisal Salman
97e4a89685 Merge pull request #510 from L15018105103/ie8-fix
Fix #509 add support for Internet Explorer 8
2023-01-26 08:46:37 +07:00
Faisal Salman
1a521b867f Utilize navigator.userAgentData as a fallback #588 2023-01-25 01:39:23 +07:00
Faisal Salman
5d4ca2b4c2 Fix #621 - Detect Oculus Quest Pro 2023-01-24 23:28:03 +07:00
Faisal Salman
cf093222e5 Fix #557 #612 #629 - Update the changelog 2023-01-24 00:42:40 +07:00
Faisal Salman
f2d0db001d Bump version 0.7.33 2023-01-22 22:26:12 +07:00
Faisal Salman
a6140a17dd Remove unsafe regex in trim() function
`trim()` function contains a regular expression that is vulnerable to ReDoS but was uncaught by `safe-regex` module.
2023-01-22 22:19:45 +07:00
Garrit Franke
2033eb4aba Merge branch 'faisalman:master' into smarttv 2022-12-09 13:39:49 +01:00
Faisal Salman
a886604935 Fix #605 - Identify Macintosh as Apple device 2022-12-06 09:53:54 +07:00
Faisal Salman
b814bcd791 Merge pull request #606 from rileyjshaw/patch-1
Fix documentation
2022-12-06 09:36:29 +07:00
Garrit Franke
df7551c9b6 Add support for TechniSAT TVs and SATs 2022-11-10 11:20:44 +01:00
Garrit Franke
94f2d604d1 Merge pull request #5 from garritfra/hbbtv-samsung
Add samsung testcases
2022-11-10 09:24:21 +01:00
Garrit Franke
e5942dc505 Add samsung testcases 2022-11-10 09:07:08 +01:00
Garrit Franke
4ef9841592 Merge pull request #4 from garritfra/hbbtv-philips
Support philips smart tvs
2022-11-09 11:03:49 +01:00
Garrit Franke
528e7aea1c Support philips smart tvs 2022-11-09 11:03:13 +01:00
Garrit Franke
5e33df3b6b Merge pull request #3 from garritfra/hbbtv-jvc
Add tests for JVC smart tvs
2022-11-08 16:18:56 +01:00
Garrit Franke
a8a4e71345 Add tests for JVC smart tvs 2022-11-08 16:17:57 +01:00
Garrit Franke
1f6a7e2860 Merge pull request #2 from garritfra/hbbtv-loewe
Support Loewe Smart TVs
2022-11-08 16:01:15 +01:00
Garrit Franke
db5567d614 Support Loewe Smart TVs 2022-11-08 15:56:40 +01:00
Garrit Franke
2f7017b4d5 Merge pull request #1 from garritfra/hbbtv-panasonic
Hbbtv panasonic
2022-11-08 15:42:02 +01:00
Garrit Franke
8ffdf232f4 Add test for panasonic SAT receiver 2022-11-08 15:30:54 +01:00
Garrit Franke
98096f1454 Add test for panasonic 2020 smart tv 2022-11-08 15:28:14 +01:00
Garrit Franke
5fd47ee00d Support Panasonic 2018+ smart tvs 2022-11-08 15:26:12 +01:00
Garrit Franke
6fde0d92d6 Support Panasonic Viera Smart TVs 2022-11-08 15:08:50 +01:00
Riley Shaw
7f71024161 Fix documentation
`readme.md` refers to a `parser.getResults` function, which does not exist. This PR corrects the function name to `getResult`.
2022-10-26 13:17:33 -04:00
Faisal Salman
c239ac5167 Merge pull request #604 from obecerra3/master
Add new browser: Cobalt
2022-10-23 17:36:19 +07:00
Oscar Becerra
8d3c2d327c Add new browser: Cobalt 2022-10-17 14:03:53 -07:00
Faisal Salman
d11fc47dc9 Bump version 0.7.32 2022-10-15 16:15:14 +07:00
Faisal Salman
b490110109 Merge branch 'develop' of github.com:faisalman/ua-parser-js 2022-10-15 16:06:28 +07:00
Faisal Salman
cb5da5ea4b Merge pull request #600 from moekm/develop
Improved documentation README.md
2022-10-15 11:35:42 +07:00
Mok
b2d685dd9c improved documentation 2022-10-09 15:09:25 +03:00
Faisal Salman
8d21e34201 Merge pull request #598 from kNoAPP/knoapp-tab-s8
Fix #596 - Detect Galaxy Tab S8 as tablet
2022-09-27 09:08:00 +07:00
kNoAPP
48d930f0f1 Add test case 2022-09-20 12:01:17 -07:00
kNoAPP
55b5b40c7d Fix #596 - Detect Galaxy Tab S8 as tablet 2022-09-20 11:56:24 -07:00
Faisal Salman
d141915d45 Merge branch 'develop' 2022-09-18 16:37:29 +07:00
Faisal Salman
8483ac09b3 Refine small redundancy 2022-09-18 16:37:13 +07:00
Faisal Salman
896bdd04e4 Merge branch 'master' of github.com:faisalman/ua-parser-js 2022-09-18 16:29:57 +07:00
Faisal Salman
25fff62540 Fix #502 #580 : Add notice for desktop device type 2022-09-18 16:11:36 +07:00
Faisal Salman
ea04d018bb Merge pull request #589 from choo737/master
fixed sony bravia smart tv, added sharp AQUOS TV
2022-09-18 15:54:00 +07:00
Faisal Salman
29b613deee Merge pull request #583 from varunsh-coder/token-perms
ci: add GitHub token permissions for workflow
2022-09-18 15:53:07 +07:00
Faisal Salman
238391a977 Merge pull request #595 from nabetama/master
Safari and Mobile Safari began to include commas in the minor version number
2022-09-18 15:39:43 +07:00
Faisal Salman
384f780a70 Merge pull request #571 from XhmikosR/patch-1
package.json: specify the folders to include
2022-09-18 15:36:10 +07:00
nabetama
75e58525fe Safari and Mobile Safari began to include commas in the minor version numbers. 2022-09-15 23:10:12 +09:00
Jacky Choo
ebb32d1ad9 fixed sony bravia smart tv, added sharp AQUOS TV 2022-07-27 17:41:35 +08:00
Varun Sharma
dea39e1693 ci: add GitHub token permissions for workflow
Signed-off-by: Varun Sharma <varunsh@stepsecurity.io>
2022-07-11 07:45:10 -07:00
Faisal Salman
ca417e25a9 Fix #516 - Add Focus into list of possible browser.name 2022-07-05 00:03:52 +07:00
Faisal Salman
f54d3fadac Fix #513 - Add new browser: DuckDuckGo 2022-07-02 23:06:08 +07:00
Faisal Salman
21fe76742f Fix #532 - Detect Xiaomi Mi TV as smarttv 2022-07-01 01:14:36 +07:00
Faisal Salman
30ac448a0c Increase UA_MAX_LENGTH to 350 2022-07-01 00:39:36 +07:00
Faisal Salman
1e82d7d265 Fix #558 - WeGame mistakenly identified as WeChat 2022-07-01 00:32:10 +07:00
Faisal Salman
a5cdc2975b Fix #565 - Add new OS: HarmonyOS 2022-06-30 23:46:42 +07:00
Faisal Salman
180846b80a Rename 'HuaweiBrowser' to 'Huawei Browser' 2022-06-30 23:39:48 +07:00
Faisal Salman
061a7a6145 Merge pull request #570 from jparismorgan/HuaweiBrowser
Add support for HuaweiBrowser
2022-06-30 23:28:01 +07:00
Faisal Salman
ebebf0acb3 Merge pull request #579 from JBYoshi/linkedin
Add LinkedIn app.
2022-06-21 12:19:44 +07:00
Faisal Salman
15ae12b71d Merge pull request #576 from Dante-dan/patch-1
fix browser-test typo
2022-05-25 18:13:19 +07:00
JBYoshi
4f77fbb441 Add LinkedIn app. 2022-05-24 23:02:01 -05:00
Dante
cd25bc1866 fix browser-test typo 2022-05-03 15:46:27 +08:00
KnifeLemon
534ba7dd7c Add iOS Naver, Kakao regex 2022-04-12 16:21:31 +09:00
KnifeLemon
0b423078c8 Add Kakao App, Naver App 2022-04-12 14:17:48 +09:00
KnifeLemon
779b5dc1e5 add KakaoTalk App, KakaoStory App regex 2022-04-12 12:57:28 +09:00
XhmikosR
18a4e5ade2 package.json: specify the folders to include 2022-03-24 08:07:30 +02:00
Paris Morgan
534d577355 update readme 2022-03-15 14:10:22 -07:00
Paris Morgan
fe963b58e5 Add support for HuaweiBrowser 2022-03-15 14:07:03 -07:00
Faisal Salman
6e39c8a553 Merge pull request #568 from jparismorgan/browser100
Add tests for Chrome, Firefox, and Edge browsers with major version 100
2022-02-25 20:41:18 +07:00
Faisal Salman
3d4ec6ef3b Merge pull request #525 from jparismorgan/Huawei
Add Huawei models
2022-02-25 20:37:01 +07:00
Paris Morgan
f02a431000 v100 tests 2022-02-17 12:01:10 -08:00
Paris Morgan
b6bddd8c09 pr feedback 2022-02-17 11:39:01 -08:00
Faisal Salman
a29213960c Fix #561 - Increase UA_MAX_LENGTH to 275 2022-01-28 22:16:51 +07:00
Faisal Salman
f761a89ab2 Fix #562 - Xiaomi Mi CC9 2022-01-13 00:35:56 +07:00
Faisal Salman
7ddb2575bd Fix #533: Detect Sony BRAVIA as SmartTV 2021-12-18 15:13:19 +07:00
Faisal Salman
23ad60ea68 Fix #559: Sony Xperia 1 III misidentified as Acer tablet 2021-12-18 01:31:40 +07:00
Faisal Salman
97f3368ef0 Bump version 0.7.31 2021-10-27 14:00:19 +07:00
Faisal Salman
b86860e850 Merge pull request #546 from hansott/master
 Use AST to verify whether regexes are safe
2021-10-27 06:27:06 +07:00
Faisal Salman
157af1e2f2 Merge pull request #547 from sunny-mwx/patch-1
Fix enumerize loop to only check its own properties
2021-10-26 17:51:31 +07:00
Faisal Salman
b4cfe1b624 Merge pull request #535 from shimar/fix/534-oppo-reno5-a
Enable to detect OPPO Reno5 A correctly.
2021-10-26 17:25:47 +07:00
Faisal Salman
95fea1cb26 Merge pull request #543 from catboy1006/master
feat: require the use of `===` and `!==`
2021-10-26 17:24:11 +07:00
Hans Ott
30648cef1d Use AST to verify whether regexes are safe 2021-10-26 11:36:19 +02:00
sunny-mwx
10c978eca5 Update ua-parser.js 2021-10-26 17:35:34 +08:00
chenhui9279
fbd2c6853c feat: require the use of === and !== 2021-10-25 16:44:54 +08:00
Faisal Salman
29d5e43342 Securing the 1.x version (issue #536) 2021-10-22 23:25:44 +07:00
Faisal Salman
051aa5d284 Securing the 0.8.x version (issue #536) 2021-10-22 23:23:12 +07:00
Faisal Salman
139fbc321a Securing the 0.7.x version (issue #536) 2021-10-22 23:14:37 +07:00
Ryohei Shima
191fed9127 Enable to detect OPPO Reno5 A correctly. 2021-10-22 12:23:36 +09:00
Faisal Salman
8fe448fddf Merge pull request #528 from jparismorgan/oculus
Add Oculus Quest and Oculus Quest 2, as well as another test for Oculus Browser
2021-10-06 11:14:42 +07:00
Paris Morgan
343d584f8f change to single line regex 2021-10-04 09:06:00 -07:00
Faisal Salman
ef54fd35d6 Merge pull request #526 from jparismorgan/sony
Add Sony Xperia 1ii
2021-09-24 00:22:42 +07:00
Paris Morgan
79535f5d61 cleanup 2021-09-21 15:40:47 -07:00
Paris Morgan
ee743946e8 cleanup 2021-09-21 15:40:04 -07:00
Paris Morgan
f57bd9523d Oculus devices 2021-09-21 15:31:02 -07:00
Paris Morgan
ffc03acd64 Add different oculus browser 2021-09-21 12:31:16 -07:00
Paris Morgan
62cc99d7cf Samsung Galaxy S20 5G 2021-09-21 12:23:49 -07:00
Paris Morgan
b542df155a Sony Xperia 1ii 2021-09-21 11:01:28 -07:00
Paris Morgan
15aa73de40 Add Huawei models 2021-09-21 09:15:49 -07:00
Faisal Salman
336ce2b950 Improve regex efficiency when trimming long ua string
https://blog.stevenlevithan.com/archives/faster-trim-javascript
2021-09-17 23:24:42 +07:00
Faisal Salman
20a428c351 Merge pull request #523 from zidingz/patch-1
Create SECURITY.md
2021-09-16 23:09:07 +07:00
Ziding Zhang
47c310e203 Create SECURITY.md
A simple instruction for security researchers.
2021-09-16 16:11:51 +01:00
liujunlve
825edbbf91 Fix #509 add support for Internet Explorer 8 2021-07-30 15:32:56 +08:00
Faisal Salman
299283c436 Fix #506 - add test for Huawei ART-L29 2021-07-22 20:31:35 +07:00
Faisal Salman
39e8d4af03 Fix #500 Sharp devices misjudged as Huawei devices 2021-06-15 12:49:19 +07:00
Faisal Salman
03c915277a Add new OS: Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
User-Agent source: whatismybrowser.com
2021-04-24 23:07:18 +07:00
Faisal Salman
1e7b6d2e8b Improve device detection: LG Android TV 2021-04-24 21:50:18 +07:00
Faisal Salman
e5e13adc81 Improve CPU detection for ARM64 2021-04-24 21:15:16 +07:00
Faisal Salman
837042a3e8 Improve device detection: Huawei, Xiaomi, Realme, LG, OnePlus, ASUS, ZTE, Fairphone 2021-04-22 07:00:28 +07:00
Faisal Salman
7b3aa9fc15 ES3 compat-fix: remove trailing comma 2021-04-18 14:10:56 +07:00
Faisal Salman
8e55e00177 Replace \s with space, saving ~0,3KB 2021-04-16 23:02:11 +07:00
Faisal Salman
ca644313d6 Remove oldEdge map 2021-04-16 12:51:45 +07:00
Faisal Salman
ca83d4c9c3 Refine some OS detection
Source:
- https://www.zytrax.com/tech/web/browser_ids.htm
- https://developers.whatismybrowser.com/useragents/explore/operating_system_name/
2021-04-16 07:11:23 +07:00
Faisal Salman
9bed2b1437 Add new device vendor: Roku
Source: https://github.com/WhichBrowser/Parser-PHP/blob/master/tests/data/television/roku.yaml
2021-04-16 05:17:04 +07:00
Faisal Salman
3792900410 Add new browsers: Obigo, UP.Browser 2021-04-12 14:02:10 +07:00
Faisal Salman
c05e4e837f Add new OS: HP-UX 2021-04-12 13:11:25 +07:00
Faisal Salman
c53a2a1f72 Improve os detection: Windows Mobile without version 2021-04-12 12:55:37 +07:00
Faisal Salman
559ecaacb6 Improve browser detection: Netscape with version 2021-04-12 12:28:24 +07:00
Faisal Salman
f715023f47 Improve device detection: categorize PDA as mobile 2021-04-12 12:24:34 +07:00
Faisal Salman
36b2275add Improve detection rule for Mac on PowerPC 2021-04-12 12:19:01 +07:00
Faisal Salman
75620c7b6c Merge branch 'master' into develop 2021-04-12 12:12:10 +07:00
Faisal Salman
1d3c98a10c Revert breaking fix #279 and release as 0.7.28 2021-04-10 21:39:40 +07:00
Faisal Salman
c39590b673 Test for Firefox UAs, add new browser: Klar, add new OS: Maemo
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
2021-04-08 23:14:10 +07:00
Faisal Salman
9200e53787 Update readme: use https for demo link 2021-04-08 21:06:52 +07:00
Faisal Salman
6c671dd246 Refactor code: saving bytes towards 15KB minified 2021-04-08 20:44:13 +07:00
Faisal Salman
535f11bd24 Delete redundant code 2021-04-07 21:42:13 +07:00
Faisal Salman
642c0399e8 Fix #492 LG TV WebOS detection 2021-04-06 14:56:23 +07:00
Faisal Salman
3edacddb24 Merge branch 'master' into develop 2021-04-05 23:32:24 +07:00
Faisal Salman
acc0b91ff5 Update contributor list 2021-04-05 23:32:15 +07:00
Faisal Salman
f726dcd1ae Merge branch 'master' into develop 2021-04-05 13:24:46 +07:00
Faisal Salman
383ca587ef More test for tablet devices 2021-04-04 16:32:30 +07:00
Faisal Salman
7c8aa435b2 Minor rearrangement 2021-04-04 14:37:13 +07:00
Faisal Salman
09aa9105dc Add new device & browser: Tesla 2021-04-04 14:12:40 +07:00
Faisal Salman
557cc2198d More test for latest phones with unique form factor (fold/flip/qwerty/swivel) 2021-04-04 13:12:55 +07:00
Faisal Salman
f95aced43b Release as 0.7.27 2021-04-02 18:18:49 +07:00
Faisal Salman
24950f97ae Merge branch 'master' of github.com:faisalman/ua-parser-js into master 2021-04-02 18:15:28 +07:00
Faisal Salman
cb30756f48 Merge pull request #490 from SuperOleg39/fix-set-ua-limit
Add string check to setUA method
2021-04-02 18:15:04 +07:00
o.drapeza
0868e372e0 Add string check to setUA method 2021-04-02 12:52:30 +03:00
Faisal Salman
9d431cfddd Add new device: Fairphone 2021-04-02 10:10:47 +07:00
Faisal Salman
c937400e8e Add new browser: Firefox Reality 2021-04-02 01:00:50 +07:00
Faisal Salman
8bea5c552a Add new Engine & Browser: Flow 2021-04-02 00:15:20 +07:00
Faisal Salman
3843578de9 Small refactor 2021-04-01 23:55:20 +07:00
Faisal Salman
be9a066029 Merge pull request #487 from kueez/kueez-develop
Better tablet detection
2021-03-29 23:53:21 +07:00
sUP
6f2ba7fcd5 Better tablet detection:
- iPad using Facebook browser on some occasions
- More Huawei tablets
- Asus ZenPad Z8s (P00J)
2021-03-29 18:40:41 +03:00
sUP
d72de26ef9 Better tablet detection - Build. 2021-03-29 16:17:18 +03:00
sUP
80fae81eee Better tablet detection:
- Fix lenovo phone / tablet detection
2021-03-29 16:04:00 +03:00
sUP
91fa6dd5cc Better tablet detection:
- Huawei MediaPad M/T
- Galaxy Tab SM-P
- Kindle Fire without Silk
2021-03-29 15:42:44 +03:00
Faisal Salman
a6b0c165c4 Release as 0.7.26 2021-03-27 02:43:24 +07:00
Faisal Salman
999764cf36 Merge branch 'old-edge-fix' into develop 2021-03-27 02:29:18 +07:00
Faisal Salman
0e70fc4044 Add new device.vendor: Realme 2021-03-27 02:21:18 +07:00
Faisal Salman
3b703a6379 Refine device detection with more test cases 2021-03-27 00:45:26 +07:00
Faisal Salman
4f27489ccf Fix regexes that were marked as unsafe by safe-regex module 2021-03-26 21:17:35 +07:00
Faisal Salman
2cfd792d24 Fix #342 - Enforce all regexes to comply with safe-regex as a safeguard against possible ReDoS vulnerability 2021-03-26 19:54:32 +07:00
Faisal Salman
b406b5df2c Merge branch 'refactor-experimental' into develop 2021-03-26 16:38:34 +07:00
Faisal Salman
536b9e8d9d Add new device.vendor: Vivo 2021-03-26 15:54:09 +07:00
Faisal Salman
8d5685771d Refine some detection with more test cases 2021-03-25 23:18:46 +07:00
Faisal Salman
69a568ae49 Casually save some bytes 2021-03-25 15:45:18 +07:00
Faisal Salman
59d947dcab Detect ARMEABI as ARM 2021-03-25 01:56:19 +07:00
Faisal Salman
62cb5a2e54 Add some test cases for Samsung, Huawei, Xiaomi 2021-03-25 01:54:30 +07:00
Faisal Salman
cd61aef07d Add Device: Surface Duo 2021-03-25 00:13:24 +07:00
Faisal Salman
afe62e915d Add new OS: Raspbian 2021-03-25 00:06:12 +07:00
Faisal Salman
ef4eeadcd8 Refine some OS detection 2021-03-25 00:00:30 +07:00
Faisal Salman
3da59cef3d Release as 0.7.25 2021-03-24 15:51:45 +07:00
Faisal Salman
a0b40be04f Simplify Huawei detection 2021-03-24 15:37:20 +07:00
Faisal Salman
73fb12b379 Add Electron 2021-03-24 02:15:50 +07:00
Faisal Salman
94d3550844 Fix #209 Add CHANGELOG 2021-03-24 01:10:51 +07:00
Faisal Salman
14e7dd3f86 Fix #448 Add AT&T & Vodafone devices 2021-03-24 00:44:14 +07:00
Faisal Salman
dff9746527 Fix #279 Remap old Edge versions <= 44 as suggested by @mikemaccana @callaginn 2021-03-24 00:09:49 +07:00
Faisal Salman
effd766e3b Fix #422 Add ARMHF in CPU Arch detection 2021-03-23 23:37:43 +07:00
Faisal Salman
4d94c6b3e3 Add CDN links & insert npm fund 2021-03-23 22:14:23 +07:00
Faisal Salman
daeb118543 Move documentation upwards and..mAkE tHe LoG0 BiG99eR!!1!1! 2021-03-23 20:31:09 +07:00
Faisal Salman
c47f458586 Merge branch 'refactor-experimental' of github.com:faisalman/ua-parser-js into refactor-experimental 2021-03-23 20:12:46 +07:00
Faisal Salman
8c2b84fc31 Enforce maximum limit to user-agent input 2021-03-23 20:10:09 +07:00
Faisal Salman
1667f5f2b2 Update README contents & structures 2021-03-21 03:40:33 +07:00
Faisal Salman
e1905168a8 Fix #438 Add Zebra devices 2021-03-20 07:54:31 +07:00
Faisal Salman
10475761cf Action doesn't work, should be under /.github/workflows folder perhaps 2021-03-19 19:29:28 +07:00
Faisal Salman
db381cad92 Change mocha reporter for CI 2021-03-19 19:21:18 +07:00
Faisal Salman
bb16473fac Fix #427 - Trying GitHub Actions 2021-03-19 19:09:24 +07:00
Faisal Salman
fe5ca1de96 Fix #401 Rearrange the order of regexes to improve hit-rate performance 2021-03-19 14:54:51 +07:00
Faisal Salman
ebccc29d97 Casually save some bytes 2021-03-18 18:42:01 +07:00
Faisal Salman
1a8cd671ab Fix #449 Lenovo Tablet 2021-03-18 02:05:57 +07:00
Faisal Salman
d1ba5f5914 Fix #430 Playstation 5 2021-03-18 00:19:41 +07:00
Faisal Salman
e402a6a55c Latest Xperia lineup 2021-03-17 10:58:50 +07:00
Faisal Salman
e612b44ecd Fix #470 Identify Android TV as SmartTV 2021-03-14 22:47:23 +07:00
Faisal Salman
fc1d3b0719 Fix #475 Nokia version incomplete 2021-03-14 22:22:04 +07:00
Faisal Salman
c626c01a5e Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2021-03-14 19:07:48 +07:00
Faisal Salman
d1ea2f0dc4 Fix #433 #434 Huawei devices 2021-03-14 19:07:28 +07:00
Faisal Salman
70a586d4b1 Merge pull request #483 from annez/check-typeof-window
Move to check typeof for window for different envs
2021-03-14 01:08:33 +07:00
Faisal Salman
9da55e9791 Merge branch 'master' of github.com:faisalman/ua-parser-js 2021-03-13 21:10:56 +07:00
Faisal Salman
6c44b3fcc5 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2021-03-13 21:04:46 +07:00
Faisal Salman
b1f34c1620 Merge pull request #477 from crcong/fixWechatDesktop
FIX: Wechat Desktop for Windows compatible with new version
2021-03-13 21:00:59 +07:00
ruicong
1cfe34f517 FIX: new wechat desktop's unsafe regex 2021-03-13 14:26:42 +08:00
Faisal Salman
6c87e069ec Fix #407 ZTE Nubia misidentified as Nextbook Tablet 2021-03-13 11:41:56 +07:00
Faisal Salman
d658ef364b Fix #339 Add Weibo 2021-03-13 09:34:22 +07:00
Faisal Salman
f85dc8cb9a Fix #366 Amazon Alexa Echo Show 2021-03-13 09:22:56 +07:00
Faisal Salman
cdac86782b Add Nintendo Switch 2021-03-13 08:47:06 +07:00
Faisal Salman
46615e70db Fix #454 Improve Samsung detection 2021-03-12 19:20:17 +07:00
Faisal Salman
6aa3ff1374 Fix #450 Sony Xperia Z2 Tablet 2021-03-12 17:40:07 +07:00
Faisal Salman
dce862364b Add funding support links 2021-03-10 00:55:26 +07:00
Faisal Salman
ec5a864abb Fix #367 #425 Detect Instagram in-app browser 2021-03-09 02:32:10 +07:00
Faisal Salman
d78a2e0361 Fix #413 Bug resulting Motorola model O 2021-03-09 02:13:31 +07:00
David Annez
f661da9d47 Move to check typeof for window for different envs 2021-02-26 10:14:32 +00:00
Faisal Salman
9999815ac8 Update version number to 0.7.24 2021-02-12 10:01:25 +07:00
Faisal Salman
809439e20e Fix potential ReDoS vulnerability as reported by Doyensec 2021-02-12 09:53:26 +07:00
Faisal Salman
5b83893476 Merge pull request #479 from joeyparrish/develop
fix: Xbox OS detection
2021-02-10 15:41:56 +07:00
Joey Parrish
9d154cc41b chore: Update build 2021-02-09 12:42:27 -08:00
Joey Parrish
7679003f87 fix: Xbox OS detection
It is better to detect Xbox devices as having the OS "Xbox".
Otherwise, they are detected as "Windows 10", making it difficult to
see the difference between Legacy Edge on Windows and the Xbox
browser.  (Karma (https://github.com/karma-runner/karma) only shows
the browser & OS on the status line.)

With this change, Xbox 360, Xbox One, Xbox X/S, and Xbox Series X/S
are all detected as OS "Xbox" with version "360", "One", etc.
2021-02-09 12:24:17 -08:00
ruicong
cd1bfd87c5 FIX: Wechat Desktop for Windows compatible with new version 2021-01-18 17:11:53 +08:00
Faisal Salman
45bf76a0fe Merge pull request #474 from dust-off/master
Fallback for Mobile
2021-01-08 14:41:15 +07:00
Dustin
f543c5ad72 facebook movile app with no browser info 2021-01-07 09:41:20 -08:00
Faisal Salman
89a72c27a7 Merge pull request #471 from jishidaaaaa/fix-firetv-detection
Fix Detection Rule For Amazon Fire TV
2021-01-05 23:46:45 +07:00
Faisal Salman
314131d003 Merge pull request #472 from GeraldHost/master
Update readme playstation typo
2021-01-05 23:44:08 +07:00
Gerald Host
386ebc29f1 feat: update readme playstation
Update Playstation to PlayStation as "Playstation" is not a known user agent.
2021-01-05 12:59:41 +00:00
Junki-Ishida
b0f14de2a4 Fix Detection Rule For Amazon Fire TV 2021-01-05 21:19:07 +09:00
Faisal Salman
fd8a583020 Merge pull request #469 from bynice/patch-1
Update ua-parser.js
2021-01-02 11:02:15 +07:00
Faisal Salman
cc2da937c6 Merge pull request #368 from Deliaz/master
Add Coc Coc browser detection
2020-12-17 20:07:49 +07:00
Yılmaz
34e2e800c5 Update ua-parser.js
Samsung Tablet SM-P587 must be Tablet device type
2020-12-17 15:39:17 +03:00
Deliaz
26c74ef356 Merge branch 'develop' into master 2020-12-16 19:37:22 +02:00
Faisal Salman
e4b3029668 Merge pull request #466 from yoyo837/patch-1
Update homepage
2020-12-13 12:43:11 +07:00
Amumu
b7d4865afd Update homepage 2020-12-13 10:59:01 +08:00
Faisal Salman
d5ab75a14e Merge branch 'master' of github.com:faisalman/ua-parser-js 2020-12-10 10:47:08 +07:00
Faisal Salman
c7475db860 0.7.23 2020-12-10 10:45:16 +07:00
Faisal Salman
83d37b4887 Merge pull request #451 from dineshks1/master
Adds travis jobs on ppc64le
2020-12-03 15:32:35 +07:00
Faisal Salman
2d53ceb8bf Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2020-12-01 10:50:17 +07:00
Faisal Salman
d107155a57 Merge pull request #463 from vinyldarkscratch/bump-deps
Bump version for all dependencies
2020-12-01 10:36:46 +07:00
Faisal Salman
43fb4d16a7 Merge pull request #459 from WizKid/master
Amazon Fire do not always contain build number
2020-12-01 10:36:11 +07:00
Faisal Salman
6d1f26df05 Fix ReDoS vulnerabilities reported by Snyk 2020-12-01 10:09:58 +07:00
Faisal Salman
86471ad7e2 Merge branch 'master' into develop 2020-11-30 23:16:15 +07:00
Faisal Salman
9dfa5fc675 Fix #453 - ReDoS vulnerability in MachSpeed tablets detection as reported by @migueldemoura 2020-11-30 23:15:30 +07:00
Queen Vinyl Darkscratch
4547dbc0b4 Bump version for all dependencies 2020-11-28 05:42:37 -08:00
Emil Hesslow
7b23335d29 Amazon Fire do not always contain build number 2020-11-23 13:43:33 -08:00
dineshks1
da53c35f91 Adds travis jobs on ppc64le 2020-10-28 12:12:40 +00:00
Faisal Salman
edd84eaa72 Fix #447 - Improve identification for LG SmartTV 2020-10-01 12:16:54 +07:00
Faisal Salman
1a75bc845f Fix #444 - Identify unknown Firefox-based browser as "Firefox" rather than "Mozilla" 2020-09-17 23:29:17 +07:00
Faisal Salman
e72371c34d bump version to 0.7.22 2020-09-12 16:06:20 +07:00
Faisal Salman
e96f95802d Refine Xiaomi detection 2020-09-12 15:56:30 +07:00
Faisal Salman
aa190ad319 Merge branch 'master' into develop 2020-09-12 15:50:06 +07:00
Faisal Salman
233d3bae22 Fix potential ReDoS vulnerability 2020-09-12 15:47:15 +07:00
Faisal Salman
3547f16d08 Merge pull request #437 from RomanSavarin/samsung-note-10
Detect Samsung Note 10.1 as a tablet
2020-09-11 21:31:46 +07:00
Raman Savaryn
da113f9fad Merge branch 'develop' into samsung-note-10 2020-08-18 08:14:55 +03:00
Faisal Salman
150ad0b176 Merge pull request #439 from joeyparrish/develop
Extract Chromecast firmware version
2020-08-13 13:58:24 +07:00
Faisal Salman
ba5324d3cd Merge pull request #436 from derUli/develop
Detect SM-P610 / Samsung Galaxy Tab S6 Lite as tablet
2020-08-13 13:55:39 +07:00
Faisal Salman
631d0501bb Merge pull request #426 from nionata/feature/facebook
Detect Facebook In-App Browsers without versions
2020-08-13 13:51:34 +07:00
Joey Parrish
20ceaf9000 Extract Chromecast firmware version
Rather than put the CPU type as the OS version, for Chromecast, the
firmware version would be much more useful.

For example:

  Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like
  Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786

This should produce:

  os: { name: "Chromecast", version: "1.42.183786" }

Instead of:

  os: { name: "Linux", version: "aarch64" }
2020-08-12 11:00:51 -07:00
roman.savarin
a8972c7d70 Detect Samsung Note 10.1 as a tablet 2020-07-31 17:04:50 +03:00
Ulrich Schmidt
8196cb1c43 detect SM-P610 / Samsung Galaxy Tab S6 Lite as tablet 2020-07-21 14:18:50 +02:00
Nicholas Ionata
624eaf3f8a Merge branch 'develop' into feature/facebook 2020-06-03 18:35:41 -04:00
nionata
4ca311224f catch facebook in-app browsers that do not contain versions 2020-06-03 18:10:56 -04:00
Faisal Salman
5230745280 Merge pull request #424 from patrick-nurt/detect-huawei-p30
Detect Huawei P30
2020-05-19 01:00:34 +07:00
patrick-nurt
cc11bc6a2c Update device-test.json 2020-05-17 08:20:27 +04:00
patrick-nurt
bd6dee4a08 Update ua-parser.js 2020-05-17 08:17:30 +04:00
Faisal Salman
1fc9d5a4a4 Merge pull request #409 from masahills/devlocal
Detect Android models from unidentified device vendors.
2020-01-25 11:45:20 +07:00
Masahiko Sato
7568f0a6f5 Updated the regexp patterns to be simpler/safer. 2020-01-20 17:15:57 +09:00
Masahiko Sato
726a458c84 Try to detect Android device models from unidentified vendors. 2020-01-17 15:42:02 +09:00
Faisal Salman
4daaa41211 Merge pull request #406 from insanehong/develop
Add  Whale Browser@NAVER Corp to list of browsers
2020-01-08 00:01:48 +07:00
insanehong
74c973b0d8 Add new browser Whale@Naver Corp. - https://whale.naver.com 2020-01-07 17:29:14 +09:00
Faisal Salman
43169ce1da Merge pull request #405 from tkrotoff/remove-script-type
No need for type="text/javascript"
2020-01-05 21:18:39 +07:00
Tanguy Krotoff
b0059eff5b No need for type="text/javascript" 2020-01-05 12:46:10 +01:00
Tanguy Krotoff
ec0d7c037a Tabs => spaces 2020-01-05 12:45:40 +01:00
Faisal Salman
a8eac11d82 Simplify Huawei regex 2019-12-21 05:49:32 +07:00
Faisal Salman
e15ac48f0f Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2019-12-21 05:36:39 +07:00
Faisal Salman
74cb3d417b Merge pull request #404 from 8thwall/huaweiProDevices
Added Huawei P20 Pro and Huawei Mate P20 Pro Device Detection
2019-12-21 05:25:44 +07:00
Tony Tomarchio
b45bd07bab Add additional model numbers for Huawei Mate 20 Pro 2019-12-19 11:10:06 -08:00
Tony Tomarchio
feafa4d027 Detect Huawei P20 Pro 2019-12-19 11:10:06 -08:00
Tony Tomarchio
fc08e23f54 Detect Huawei Mate 20 Pro 2019-12-19 11:10:06 -08:00
Faisal Salman
590234ba13 Merge pull request #402 from ChadKillingsworth/pixels
Add detection for newer Pixel devices
2019-12-20 01:21:32 +07:00
Faisal Salman
31a0460b60 v0.7.21 2019-12-19 23:11:25 +07:00
Faisal Salman
e1dd27cc3f Update README 2019-12-19 23:01:31 +07:00
Faisal Salman
e14dcd598c Fix #351: Identify Huawei MediaPad as tablet 2019-12-14 22:41:59 +07:00
Faisal Salman
d260bcca37 Remove redundant rule for OnePlus 2019-12-14 19:06:53 +07:00
Faisal Salman
9da7fd4f92 Fix #395: Add 360 Browser 2019-12-14 07:30:43 +07:00
Faisal Salman
5cbd2fa795 Fix #389 TypeError when $=null 2019-12-14 06:20:34 +07:00
Faisal Salman
7fca67cbc7 Add OS: KaiOS 2019-12-14 05:49:00 +07:00
Chad Killingsworth
ac123a98de Add detection for newer Pixel devices 2019-12-04 07:08:51 -06:00
Faisal Salman
65b3804625 Merge pull request #399 from MimyyK/master
Add new devices OnePlus
2019-11-16 23:13:53 +07:00
MimyyK
c558a64ec5 Add new devices (OnePlus 6 and OnePlus 6T) 2019-11-15 12:04:23 +01:00
Faisal Salman
c191372e67 Merge pull request #393 from ll-syber/baidubox
Add Baidu App detection
2019-09-25 12:45:11 +07:00
ll-syber
5050ef75f6 1. merge baidubrowser with bidubrowser, and place them in "trident based"
2. add baiduboxapp, which stand for "Baidu App on mobile"
2019-09-17 19:52:12 +08:00
Faisal Salman
3768a26e5d Merge pull request #390 from JBYoshi/blink-version
Use Chrome version for Blink version.
2019-09-09 23:26:14 +07:00
Faisal Salman
12a96a992a Merge pull request #392 from JBYoshi/smart-tv-type
Classify Apple TV and Chromecast as smart TVs.
2019-09-05 19:09:53 +07:00
JBYoshi
3a78cf598d Classify Apple TV and Chromecast as smart TVs. 2019-09-04 10:21:13 -05:00
JBYoshi
8457f61f60 Fix whitespace. 2019-08-28 21:16:40 -05:00
JBYoshi
ca14b133cb Use Chrome version for Blink version. 2019-08-28 21:12:14 -05:00
Faisal Salman
411e41afd8 Merge pull request #374 from pavelstudeny/master
Add Avast Secure Browser & AVG Secure Browser
2019-08-27 14:25:02 +07:00
Faisal Salman
44d4ed5350 Merge pull request #383 from 8thwall/huaweiDevices
Detect Huawei P20, P20 Lite and P30 Pro
2019-08-27 14:21:39 +07:00
Tony Tomarchio
e5a02c0e57 Detect Huawei P20 2019-07-24 10:52:13 -07:00
Alvin Portillo
c752520041 Detect Huawei P20 Lite and P30 Pro 2019-07-19 14:45:34 -07:00
Pavel Studeny
ee391c8888 fix comment 2019-06-21 09:43:12 +02:00
Faisal Salman
a88934fadf v0.7.20 - released under the MIT license 2019-06-08 21:50:39 +07:00
Faisal Salman
8cf2a87938 Fix #379 Detect Lenovo Tab 2019-06-08 21:10:52 +07:00
Faisal Salman
b1d6eda6e1 Fix #378 Detect Samsung Galaxy C9 Pro 2019-06-08 20:51:31 +07:00
Faisal Salman
a9fc6163b8 Fix #289 Detect Xiaomi Mi as Mobile 2019-06-08 20:39:31 +07:00
Faisal Salman
7ef62a68de Fix #318 Detect Meizu Note as Mobile 2019-06-08 20:28:14 +07:00
Faisal Salman
de3b3bd55e Merge pull request #372 from maxnordlund/patch-2
Remove outcommented code
2019-06-08 18:57:19 +07:00
Faisal Salman
700220f2b9 Merge pull request #380 from evaliyev/fix_license
Fix license
2019-06-08 18:54:52 +07:00
Elchin Valiyev
90ae87ec17 Update README 2019-06-05 17:02:46 +02:00
Elchin Valiyev
f60fdbefa5 fix license in package.json 2019-06-05 16:48:01 +02:00
Faisal Salman
97e919024b Merge pull request #375 from IldarKamalov/develop
Fixed Edge Chromium detection
2019-05-23 17:21:31 +07:00
Ildar Kamalov
a88b70bdd4 Fixed Edge Chromium detection
Closes #373
2019-04-13 10:48:53 +03:00
Pavel Studeny
0b7d05bae0 Add AVG Secure Browser detection 2019-04-10 16:38:13 +02:00
Pavel Studeny
7d4d9fd476 Add Avast Secure Browser detection 2019-04-10 16:22:15 +02:00
Faisal Salman
89635fcc6e Merge pull request #371 from maxnordlund/patch-1
Fix typo
2019-03-26 13:39:08 +07:00
Faisal Salman
b6d2bb5262 Merge pull request #369 from symunona/rjs-fix
FIX: When using as AMD module with RequireJS optimizer using a namespace
2019-03-26 13:38:49 +07:00
Faisal Salman
73192e64d4 Merge pull request #364 from rainemak/sailfishos
Add Sailfish OS and Sailfish Browser detection
2019-03-26 13:38:28 +07:00
Faisal Salman
557c46f413 Merge pull request #359 from hr6r/develop
WeChat(Win) Desktop
2019-03-26 13:38:20 +07:00
Faisal Salman
9fb502ea6d Merge pull request #353 from 8thwall/pixelFix
Fix Pixel XL devices on Chrome 70
2019-03-26 13:38:11 +07:00
Max Nordlund gmail
37cac21d0c Remove outdated TODO
This todo was written in April 2015, which at the time of this commit is
almost 4 years ago. See 6a284e26
2019-03-25 12:23:21 +01:00
Max Nordlund gmail
95f37b4ce5 Remove unused media players
This got disabled ~4 years ago, see 5d817e37
2019-03-25 12:20:06 +01:00
Max Nordlund gmail
cc479f81ae Remove outcommented code
Hasn't been used for years, so it's most likely safe to remove.
2019-03-25 12:14:31 +01:00
Max Nordlund
d1a7f365ad Remove disabled CLI functionality
See #268
2019-03-25 12:12:39 +01:00
Max Nordlund
a4da1e2b65 Remove outcommented code
It was disabled 2 years ago, see #258
2019-03-25 12:11:44 +01:00
Max Nordlund
795139e1b8 Fix typo
Changes `margedRegexes` -> `mergedRegexes`
2019-03-25 11:54:55 +01:00
Bendeguz
97dc89ae03 FIX: When using in an AMD module with RequireJS using a namespace,
it does not get packed correctly, because r.js optimizer matches
the exact line containing 'function' as a string. (See r.js@26506)
2019-03-19 10:57:36 +01:00
Deliaz
cd3ba72b2f Add Coc Coc browser detection 2019-03-18 13:17:44 +07:00
Raine Makelainen
995e872ff8 Add Sailfish OS and Sailfish Browser detection 2019-03-01 14:50:54 +02:00
hr6r
3bad800860 Merge branch 'develop' into develop 2019-01-23 14:46:05 +08:00
dianhe
bc4fd7417c test name 2019-01-23 14:43:56 +08:00
dianhe
6f27f8b862 + 'WeChat(Win) Desktop' 2019-01-23 14:32:30 +08:00
Alvin Portillo
df5229cb62 Fix Pixel XL devices on Chrome 70 2018-11-30 11:00:24 -08:00
Faisal Salman
732cf5834e Fix #337 - Samsung Smart-TV 2018-11-23 10:26:00 +07:00
Faisal Salman
ddcc29f63f Fix #303 - Acer Iconia 2018-11-23 09:23:13 +07:00
Faisal Salman
ce95d9ac17 Fix #323 - Detect Asus ZenPad 10 2018-11-23 01:15:06 +07:00
Faisal Salman
56978dec0a Fix #327: iPad identified as mobile when using UCBrowser 2018-11-23 00:52:07 +07:00
Faisal Salman
60c4c2b693 Fix #252: Detection for HTC Desire 820 2018-11-23 00:38:19 +07:00
Faisal Salman
213d2296df Update list 2018-11-23 00:17:42 +07:00
Faisal Salman
ed1ccb3902 Fix #340 - Add Browser: QupZilla, Falkon 2018-11-22 23:40:26 +07:00
Faisal Salman
61e5d24bb5 Add Engine: Goanna 2018-11-22 23:33:42 +07:00
Faisal Salman
7c5991a725 Fix #341: Detect Konqueror before Safari 2018-11-22 13:49:59 +07:00
Faisal Salman
3a5a701375 Fix #246 #247 - Add Engine: Blink 2018-11-22 13:21:09 +07:00
Faisal Salman
f6ef14d0cd Fix #349 Sony w/ Chrome >=70 2018-11-09 12:29:19 +07:00
Faisal Salman
7aca357879 Fix #328 New release 0.7.19 2018-10-26 01:35:15 +07:00
Faisal Salman
7f8f357995 Remove Node 0.10 from Travis 2018-10-26 01:17:13 +07:00
Faisal Salman
0fd919bd51 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2018-10-26 00:53:15 +07:00
Faisal Salman
a400d2163c Fix #347 Pixel C in Chrome 70 2018-10-26 00:52:27 +07:00
Faisal Salman
073c672af5 Add OS: Fuchsia 2018-10-26 00:48:05 +07:00
Faisal Salman
93e17524c0 Add OS: Fuchsia 2018-10-26 00:37:15 +07:00
Faisal Salman
2c7e61f9a2 Add Device: Essential & Google Pixel 2018-10-26 00:35:59 +07:00
Faisal Salman
87c6e5c1bd Merge pull request #346 from 8thwall/essential
Detect Essential Phone (PH-1)
2018-10-25 23:00:59 +07:00
Faisal Salman
b88c52131f Merge pull request #345 from 8thwall/pixel3
Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models
2018-10-25 22:56:46 +07:00
Alvin Portillo
6c2a767e32 Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models 2018-10-22 11:28:31 -07:00
Alvin Portillo
7dbf0c6867 Detect Essential Phone (PH-1) 2018-10-22 10:29:19 -07:00
Faisal Salman
0304152f72 Merge branch 'master' of github.com:faisalman/ua-parser-js 2018-10-21 15:21:53 +07:00
Faisal Salman
4cc29dd88c Update readme: using TypeScript 2018-10-21 15:21:03 +07:00
Faisal Salman
95fcd3f672 Fix #321: Add a LICENSE to be recognized by GitHub API 2018-10-13 10:01:51 +07:00
Faisal Salman
d7608d0459 Merge pull request #338 from coox/master
Fix browser detection of Edge on Android
2018-10-06 23:32:20 +07:00
Faisal Salman
f8820389a9 Merge branch 'develop' into master 2018-10-06 23:30:37 +07:00
Faisal Salman
46b9f0f2aa Merge pull request #334 from vladimyr/develop
Detect Firefox Focus & Opera Touch
2018-10-06 23:28:47 +07:00
Faisal Salman
41ccecadea Merge pull request #333 from brave/master
add Brave to list of browsers
2018-10-06 23:28:29 +07:00
Eric Redon
964431ef89 Fix browser detection of Edge on Android 2018-09-27 17:50:54 +02:00
Dario Vladovic
bf79eabecc Improve Microsoft Edge detection 2018-09-16 12:19:47 +02:00
Dario Vladovic
01eab85f7d Add Opera Touch & Firefox Focus, fix Microsoft Edge 2018-09-16 12:07:18 +02:00
Dario Vladovic
384bafe31c Prevent package-lock creation 2018-09-16 11:46:11 +02:00
Dario Vladovic
eb83122c5e Update .gitignore 2018-09-16 11:40:03 +02:00
Matthew O
64bd8a4e60 Merge pull request #1 from KarateCowboy/add-brave
add Brave browser
2018-09-14 16:05:27 -05:00
Matthew Origer
fc4c0df095 add Brave browser 2018-09-14 15:57:26 -05:00
Faisal Salman
a142c0ee94 Update filesize description 2018-09-08 16:13:45 +07:00
Faisal Salman
5c30aeed59 Merge branch 'master' of github.com:faisalman/ua-parser-js 2018-09-08 16:07:57 +07:00
Faisal Salman
00064be6d6 Merge pull request #325 from dcyriller/update-readme
Update browser names in README
2018-09-08 16:04:28 +07:00
Faisal Salman
76be1cb328 Fix test for Meizu device 2018-09-08 14:21:36 +07:00
Faisal Salman
d601ab195f Merge branch 'shchotse-add_true_meizu_device_type' into develop 2018-09-08 14:19:00 +07:00
Faisal Salman
ac3b0624b8 Identify MZ as Meizu #263 2018-09-08 14:17:22 +07:00
Cyrille David
b49865266c Update browser names in README 2018-07-26 11:58:21 +02:00
Cyrille David
565d67bbb6 Remove unconsistant (because outdated?) names
Only remove names coming from README.
2018-07-26 11:42:45 +02:00
Cyrille David
58c71a019e Merge README list into extraction 2018-07-26 11:40:11 +02:00
Cyrille David
8c2607aac9 Extract browser names from test/browser-test.json 2018-07-26 11:36:10 +02:00
Faisal Salman
55ffb10a5f Fix #259: Avoid collision when using $.ua 2018-05-23 20:28:47 +07:00
Faisal Salman
1493587742 Fix #317: Add missing warranty section of MIT license in readme.md 2018-05-17 06:19:13 +07:00
Faisal Salman
f5e0aa83eb Fix #290: Add Device Model: Pixel 2 2018-05-08 15:26:38 +07:00
Faisal Salman
8fdc32f5b8 Fix #295: Detect Amazon Fire TV 2018-05-06 22:42:14 +07:00
Faisal Salman
0059eef770 Fix #293: Detect ARM on ChromeOS 2018-05-06 22:26:16 +07:00
Faisal Salman
93affc671c Replace donation button 2018-05-06 22:17:10 +07:00
Faisal Salman
a3f5efa680 Fix #212: Detect LINE 2018-05-06 22:10:39 +07:00
Faisal Salman
4c00ccc6c2 Fix #271 2018-05-06 21:05:30 +07:00
Faisal Salman
34f934fa55 increment patch version 2018-05-04 23:13:57 +07:00
Faisal Salman
218e3a4a3b Merge pull request #314 from no5no6/master
Add support for Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser
2018-05-04 08:52:35 +07:00
yuanyang
5eda2491b1 Merge branch 'master' of https://github.com/no5no6/ua-parser-js 2018-05-02 10:55:52 +08:00
yuanyang
7acaf9ced8 add Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser 2018-05-02 10:54:54 +08:00
Faisal Salman
bafac18512 Merge pull request #312 from brophdawg11/qqbrowserlite
#311 - Add support for QQBrowserLite
2018-04-29 22:03:03 +07:00
Faisal Salman
ee553df245 Merge branch 'develop' into qqbrowserlite 2018-04-29 22:02:07 +07:00
Faisal Salman
bc4e75573a Merge pull request #305 from shreedharshetty/shreedharshetty-patch-1
Incorrect browser name shows for Edge browser on mobile
2018-04-29 21:58:34 +07:00
Faisal Salman
378dee1aaa Merge pull request #310 from JoshuaKGoldberg/patch-1
Readme typo: missing "be more"
2018-04-29 21:57:29 +07:00
Faisal Salman
d413cb0745 Merge branch 'develop' into shreedharshetty-patch-1 2018-04-29 21:56:34 +07:00
Faisal Salman
7fb860f030 Merge pull request #304 from gulping/patch-1
mark license comment as important
2018-04-29 21:52:39 +07:00
Faisal Salman
2e57a9778f Merge pull request #299 from zbjornson/vulnfix
Fix vulnerable RegExps
2018-04-29 21:52:23 +07:00
yuanyang
fb92a46479 add Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser 2018-04-25 12:02:19 +08:00
Matt Brophy
4790f944bf Update README 2018-04-23 09:37:13 -04:00
Matt Brophy
3ed9d3f4ff #311 - Add support for QQBrowserLite 2018-04-23 09:36:11 -04:00
Josh Goldberg
0c6ae1a1e3 Readme typo: missing "be more" 2018-04-21 16:10:42 -07:00
Shreedhar
84bfaaf225 updated ua string for ios 2018-04-02 20:09:57 +05:30
Shreedhar
9ceb402834 fix: wrong browser name returns for edge browsers on mobiles 2018-04-02 19:52:18 +05:30
gulpin
a795cf83c4 mark license comment as important 2018-03-29 16:41:58 +09:00
Zach Bjornson
8b54a7256e Fix vulnerable RegExps
Fixes #298
2018-02-26 20:12:16 -08:00
Faisal Salman
dfb8e758d1 Merge pull request #287 from m90/patch-1
Add missing Waterfox browser to README
2018-01-11 23:24:03 +07:00
Frederik Ring
083cb66d46 Add missing Waterfox browser to README 2018-01-11 13:04:00 +01:00
Faisal Salman
50bd78afb1 Fix ReDoS vulnerability reported by Sonatype 2017-12-26 15:30:33 +07:00
Faisal Salman
ac7f87f199 Fix #272 OnePlus 2017-12-26 10:55:27 +07:00
Faisal Salman
b367a3f741 Update contributors 2017-12-26 08:29:40 +07:00
Faisal Salman
4bbd7bd27c Merge pull request #286 from loris/master
Add support for Xiaomi Mi 1/2/3/4/5/6 mobile smartphones
2017-12-18 22:49:18 +07:00
Loris Guignard
610781dac3 Add support for "Mi 5s Plus" 2017-12-15 16:32:51 +01:00
Loris Guignard
1b86f8fb94 Xiaomi tablets: Ensure the UA contains "pad" 2017-12-15 16:32:33 +01:00
Loris Guignard
0413755986 Revert /dist files 2017-12-15 16:16:39 +01:00
Loris Guignard
618c92aec9 Add support for Xiaomi Mi 1/2/3/4/5/6 mobile smartphones 2017-12-15 15:56:27 +01:00
Faisal Salman
7964f909a3 Merge pull request #280 from stiekel/master
Add Quark Browser support
2017-12-01 09:02:13 +07:00
Faisal Salman
934e077aea Merge pull request #281 from dhoko/feat/waterfox
Add support for waterfox
2017-12-01 09:01:46 +07:00
dhoko
503bb6eb06 Add support for waterfox 2017-11-29 09:11:17 +01:00
Stiekel
435335e12f Add Quark Browser support 2017-11-24 17:30:38 +08:00
Faisal Salman
a6e1ed6392 Merge pull request #278 from dhoko/feat/palemoon
Add support for palemoon browser + basilisk
2017-11-21 16:30:20 +07:00
dhoko
9dfeee5211 Add support for palemoon browser + basilisk 2017-11-21 10:25:30 +01:00
Faisal Salman
ce2a8a3939 Merge pull request #274 from bulbulpaul/fix_license
Fixed license
2017-11-21 13:18:11 +07:00
Nobuo Okada
46dfe2aeb8 Fixed license 2017-11-01 13:18:26 +09:00
Faisal Salman
9c06febfce Merge pull request #273 from bulbulpaul/fix-license
Fixed license
2017-10-31 20:05:01 +07:00
Nobuo Okada
a75de42f8e Fixed license 2017-10-31 18:59:41 +09:00
Faisal Salman
6095258673 Fix #268 revert changes 2017-10-12 15:16:23 +07:00
Faisal Salman
40aa1a693b bump version 2017-10-12 12:10:08 +07:00
Faisal Salman
25e143ee7c Fix vulnerable regex in getOS() (as reported by Nick Starke) 2017-10-12 12:07:10 +07:00
Faisal Salman
7bd9ffea24 Fix #262 Chrome Headless 2017-10-12 09:48:25 +07:00
Faisal Salman
c566f45cbd Merge branch 'master' into develop 2017-10-12 09:39:37 +07:00
Faisal Salman
3b89dff771 increment revision 0.7.15 2017-10-12 09:28:14 +07:00
Faisal Salman
5ba5e7abc9 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2017-10-12 09:19:03 +07:00
Faisal Salman
b8978f5933 Fix #262 Chrome Headless 2017-10-12 09:18:42 +07:00
Faisal Salman
eeb1b9ef81 Merge pull request #265 from brophdawg11/support-ios-gsa
Add support for Google Search Appliance on iOS
2017-10-11 21:35:06 +07:00
Faisal Salman
aeae29be66 Merge pull request #267 from LukasDrgon/patch-1
Add CDN link
2017-10-11 20:48:39 +07:00
Lukas Drgon
3ce12c0cf9 Add CDN link 2017-10-02 19:31:03 +02:00
Matt Brophy
4d95ac10ef Add support for Google Search Appliance on iOS 2017-09-19 14:19:32 -04:00
Faisal Salman
61b4a089c5 Merge pull request #264 from arunrreddy/support-device-redmi
Support device redmi
2017-09-17 06:02:39 +07:00
Arun Rama Reddy
74ec93ffb6 feat: Added Redmi phone and Mi Pad tablet detection support 2017-09-16 11:12:29 +05:30
Igor Topal
2c28b3e97e Add new Meizu device type (MZ) support, for correctly parsing 2017-09-08 17:47:07 +03:00
Faisal Salman
459f3d34f5 Issue #258 0.7.15rc 2017-08-06 08:27:02 +07:00
Faisal Salman
6f621f1ae2 New feature: CLI support 2017-08-06 07:55:22 +07:00
Faisal Salman
7ae3098778 Fix #256 tag new release 0.7.14 2017-07-19 19:39:01 +07:00
Faisal Salman
806c2b8030 move jquery.json to package.json 2017-07-19 19:35:42 +07:00
Faisal Salman
cb1a64b509 Merge some commits from branch 'develop' 2017-07-17 23:14:19 +07:00
Faisal Salman
b49cfae4e2 Opening donation 2017-07-17 22:54:45 +07:00
Faisal Salman
91b046462c Merge branch 'master' of github.com:faisalman/ua-parser-js 2017-07-17 22:51:38 +07:00
Faisal Salman
69509af6dd Merge pull request #254 from hr6r/develop
+ browser inside QQ support
2017-07-05 19:01:27 +07:00
Faisal Salman
225f703b67 Merge pull request #231 from motnik/develop
Added Multiple Tablets Detection (LG, RCA, Dell, Verizon, etc.)
2017-07-05 19:00:02 +07:00
dianhe
7f217753f5 + browser inside QQ support 2017-07-05 19:55:19 +08:00
Faisal Salman
10f9fb35ca Merge pull request #234 from Kronuz/patch-1
Fix server side rendering
2017-07-05 18:38:48 +07:00
shaharmor
7fbb93c99a Detect "Chrome Mobile" & "Firefox Mobile" 2017-07-02 16:14:23 +03:00
Faisal Salman
5ae468a3d3 uastring is optional when using extensions 2017-07-01 20:28:03 +07:00
Faisal Salman
fd46c4d2be Fix #249 Detect Huawei devices 2017-07-01 18:49:35 +07:00
Faisal Salman
297c6538bc Fix #206 Detect OS for iOS app 2017-06-28 16:12:43 +07:00
Faisal Salman
f9f9fa79e1 Fix #247 Add Oculus Browser 2017-06-28 15:57:50 +07:00
Faisal Salman
07fe58b793 Fix #220 Identify UBrowser as UCBrowser 2017-06-28 14:54:39 +07:00
Faisal Salman
3a4626b5e8 Fix #211 Distinguish Samsung Browser from Android Browser 2017-06-28 14:20:05 +07:00
Faisal Salman
3fd01f07ea Fix #235 Detect Meizu Tablet 2017-06-22 17:37:35 +07:00
Faisal Salman
d103dd5450 Fix #219 samsung mistakenly detected as sony 2017-06-22 17:04:14 +07:00
Faisal Salman
6cc6742f5e increment patch version 2017-06-22 14:20:01 +07:00
Faisal Salman
cf977c50ed remove component.json 2017-06-22 14:11:17 +07:00
Faisal Salman
4c15b10730 revert readme.md fix 2017-06-03 02:28:55 +07:00
Faisal Salman
a3c7619d3a fix readme.md conflict 2017-06-03 01:08:20 +07:00
Faisal Salman
82aba654f9 Merge pull request #242 from ebbmo/feature/recognize_facebook_browser_for_android
Facebook browser now recognized as well (not only iOS)
2017-05-23 14:55:27 +07:00
Hermann Ebert
2f1b14906f Facebook browser now recognized as well (not only iOS) 2017-05-23 09:06:58 +02:00
Faisal Salman
a3a09d33bc Merge pull request #236 from ronkorland/master
Add support for Chrome Headless user agent
2017-05-17 09:49:29 +07:00
Faisal Salman
946ba02c54 Merge pull request #228 from arturom/develop
Added Google Chromemast detection
2017-05-15 00:38:11 +07:00
Faisal Salman
d2d570fcd5 Merge pull request #233 from vladimyr/develop
Adding Opera Coast support, fixing UCBrowser detection
2017-05-15 00:33:38 +07:00
Faisal Salman
18e08428f4 Merge pull request #216 from ericschrenker/0readme
Copyedit Readme File
2017-04-26 11:15:28 +07:00
Ron Korland
552915907e Add support to Chrome Headless user agent 2017-04-13 16:42:04 +03:00
Germán M. Bravo
6984de7927 Fix server side rendering
Fixes problem when window is undefined in the server.
2017-03-30 16:13:41 -06:00
Dario Vladovic
7a68f35574 Adding support for Puffin browser 2017-03-21 18:41:51 +01:00
Dario Vladovic
2bc75f10bc Adding Opera Coast support, fixing UCBrowser detection
- pushing UCBrowser up to avoid being caught by Chrome regex
- adding regex for Opera Coast (Opera's iOS browser)
2017-03-21 18:09:15 +01:00
Nikhil Motiani
2610f37a8b Added Gigaset Tablet detection 2017-03-16 20:39:21 +05:30
Nikhil Motiani
a25bb8b1a6 Added Amazon Kindle Fire Tablet detection 2017-03-16 20:35:11 +05:30
Nikhil Motiani
ee2db31f8c Added Le-Pan Tablet detection 2017-03-16 20:27:04 +05:30
Nikhil Motiani
89775a8ae7 Added NextBook Tablet detection 2017-03-16 20:19:14 +05:30
Nikhil Motiani
7d826ed62e Improved Unidentified Tablet detection 2017-03-16 20:09:22 +05:30
Nikhil Motiani
a6316f02b0 Added Trinity Tablets detection 2017-03-16 20:06:33 +05:30
Nikhil Motiani
72a11e24b2 Added MachSpeed Tablets detection 2017-03-16 20:00:42 +05:30
Nikhil Motiani
f7ca724f3b Added Rotor Tablets detection 2017-03-16 19:56:40 +05:30
Nikhil Motiani
8d826fcc24 Added Envizen Tablets detection 2017-03-16 19:51:44 +05:30
Nikhil Motiani
951106c425 Added LvTel Phones detection 2017-03-16 19:44:21 +05:30
Nikhil Motiani
83ca52bb28 Added Voice Xtreme Phones detection 2017-03-16 19:43:50 +05:30
Nikhil Motiani
6fb4941458 Added Insignia Tablets detection 2017-03-16 15:48:22 +05:30
Nikhil Motiani
48ab3b372c Added Dragon-Touch Tablets detection 2017-03-16 15:45:39 +05:30
Nikhil Motiani
38c409e8d9 Added Zeki Tablets detection 2017-03-16 15:27:35 +05:30
Nikhil Motiani
4e2cbdfd16 Added Swiss Mobiles and Tablets detection 2017-03-16 15:19:22 +05:30
Nikhil Motiani
fbe8a0e3a6 Added Generic Android detection 2017-03-16 15:09:01 +05:30
Nikhil Motiani
8e9c400ec5 Added ZTE K-Series Tablet detection 2017-03-16 15:07:22 +05:30
Nikhil Motiani
b89fa098aa Added NuVision Tablet detection 2017-03-16 15:04:02 +05:30
Nikhil Motiani
f3882f1882 Added Barnes & Noble Tablet detection 2017-03-16 15:03:04 +05:30
Nikhil Motiani
a25426840c Added Dell Venue Tablet detection 2017-03-16 15:01:49 +05:30
Nikhil Motiani
985a7b18e0 Added Verizon Devices detection 2017-03-16 15:00:00 +05:30
Nikhil Motiani
8e09cd49e3 Added RCA Devices detection 2017-03-16 14:57:28 +05:30
Nikhil Motiani
4768992762 Added LG Generic Mobile 2017-03-16 14:54:40 +05:30
Nikhil Motiani
f89e08f2c0 Improved LG Tablet Detection 2017-03-16 14:47:11 +05:30
Arturo Mejia
fe568ffe96 Added Google Chromemast detection 2017-03-08 12:55:35 -05:00
Eric Schrenker
252db2534e 📝 copyedit readme 2017-01-17 14:43:09 -06:00
Faisal Salman
6555bf6e81 Fix #210 Refine browser: QQBrowser 2016-12-27 16:36:51 +07:00
Faisal Salman
740fc93b4b Fix #210 Add device: OPPO 2016-12-27 15:58:58 +07:00
Faisal Salman
eed646f9ce Add Bowser 2016-12-22 23:50:01 +07:00
Faisal Salman
764de40fe0 Merge pull request #205 from piperchester/patch-1
Fix formatting for consistency
2016-12-07 14:35:43 +07:00
Piper Chester
49609c0990 Fix formatting for consistency 2016-12-06 22:16:25 -08:00
Faisal Salman
ef69224d7c Edit readme 2016-12-06 13:47:30 +07:00
Faisal Salman
caa2f47c06 update uglify version 2016-12-06 12:44:16 +07:00
Faisal Salman
5177c460a5 Use constructors 2016-12-06 12:41:48 +07:00
Faisal Salman
3e2d5c1817 Update contributors 2016-11-22 14:03:54 +07:00
Faisal Salman
29a0372611 Merge branch 'master' into develop 2016-11-22 00:52:24 +07:00
Faisal Salman
2aa2f77881 Fix #186 unnecessary if statement inside while loop 2016-11-22 00:49:18 +07:00
Faisal Salman
1e228b2fbe Merge pull request #201 from roberttod/google-pixel
Add google pixel devices
2016-11-18 14:50:13 +07:00
Robert Tod
5379ec8513 Add google pixel devices
- Add Google Pixel and Google Pixel XL mobiles
- Add Google Pixel C tablet
2016-11-17 13:36:08 -05:00
Faisal Salman
01ae611dfa Build dist package 2016-11-14 10:14:01 +07:00
Faisal Salman
2de1f2a75d Remove ComponentJS support 2016-11-14 10:12:49 +07:00
Faisal Salman
975cbdc89e Bumping version: 0.7.11 -> 0.7.12 2016-11-14 10:02:07 +07:00
Faisal Salman
507714c3c7 Move logo to right 2016-11-14 00:42:43 +07:00
Faisal Salman
2b4a20d162 Edit readme 2016-11-14 00:33:56 +07:00
Faisal Salman
34848e8ec2 Fix #187 #171 #92 Require.js 2016-11-11 18:40:26 +07:00
Faisal Salman
97b52b2cfd Test unit for extension 2016-11-11 13:58:15 +07:00
Faisal Salman
9f0419607b Fix #127 galaxy note 2016-11-11 10:40:32 +07:00
Faisal Salman
b13c891d7f Fix #190 haiku 2016-11-11 09:26:59 +07:00
Faisal Salman
7f9919f896 Fix #185 Huawei Nexus 6P 2016-11-10 09:41:16 +07:00
Faisal Salman
9fe7561d78 Fix #96 Moto X 2016-11-10 09:30:04 +07:00
Faisal Salman
b99840d074 Fix #158 xiaomi mi note 2016-11-10 09:24:00 +07:00
Faisal Salman
61b0f1c054 Fix #87 oneplus one 2016-11-10 09:16:17 +07:00
Faisal Salman
58880fda7f Fix #43 #68 xperia sp & asus padfone 2016-11-10 09:11:23 +07:00
Faisal Salman
73735e1ca8 Fix #37 #38 test case for nexus 7 & ipod 2016-11-10 08:57:15 +07:00
Faisal Salman
0f0ea13fab Fix #99 Wrong Windows version 2016-11-10 00:45:48 +07:00
Faisal Salman
1fb82fb6ff Smart-TV ordering 2016-11-10 00:43:20 +07:00
Faisal Salman
88f2f4e24c Fix #32 browser recognized as version 2016-11-10 00:21:28 +07:00
Faisal Salman
1a4dab5829 Edit readme: guide to contribute 2016-11-09 23:41:57 +07:00
Faisal Salman
2467a458e3 Fix #22 #33 #34 #129 Distinguish stock Android Browser from Chrome 2016-11-09 22:37:21 +07:00
Faisal Salman
aadabcce29 Fix #188 Separate Chrome WebView from Chrome 2016-11-09 19:32:20 +07:00
Faisal Salman
d0b7c5892f Samsung smarttv misidentified as mobile 2016-11-09 19:27:41 +07:00
Faisal Salman
d3f959ee28 Split mediaplayer test cases, edit readme 2016-11-09 18:09:11 +07:00
Faisal Salman
d1a33d7d85 Test case for #174 2016-11-08 12:55:56 +07:00
Faisal Salman
3dae55a3c8 Fix #197 microsoft lumia 2016-11-08 12:55:19 +07:00
Faisal Salman
87b88246a2 Merge branch 'master' of github.com:faisalman/ua-parser-js 2016-11-07 21:34:16 +07:00
Faisal Salman
a56c990ec3 Fix #188 distinguish webview from chrome 2016-11-07 21:34:05 +07:00
Faisal Salman
458f3c3cd2 Merge pull request #196 from leventebalogh/patch-1
Fix: don't define the RequireJs module with name
2016-11-07 20:27:24 +07:00
Levente Balogh
f28f87c412 Fix: don't define the RequireJs module with name
If we define it with name it becomes less portable and breaks code that used version `0.7.10`.
This is not correct according to **semver**, as this is a `patch` only which should not break APIs.

I think defining the module with a name should be a responsibility of build tools / optimisation tools.
2016-11-07 10:34:08 +01:00
Faisal Salman
10775bd17c Increment build version to 0.7.11 2016-11-07 00:37:33 +07:00
Faisal Salman
c03a84a601 Add WeChat 2016-11-07 00:28:20 +07:00
Faisal Salman
eade7a9355 Merge pull request #167 from philippsimon/hbbtv
Get SmartTV device by HbbTV part
2016-11-07 00:15:10 +07:00
Faisal Salman
4e0aa0b88b Merge pull request #149 from dhcmrlchtdj/wechat
add support for WeChat
2016-11-07 00:11:25 +07:00
Faisal Salman
4e7c662b0b Merge pull request #173 from sueddeutsche/fix/samsung-device-detection
Add generic device detection for samsung smartphones
2016-11-07 00:02:02 +07:00
Faisal Salman
93993dc311 Merge pull request #181 from WebEngage/hp-10-tablet-device
Add device detection for HP 10 tablet
2016-11-06 23:52:34 +07:00
Faisal Salman
55e75dd1b3 Merge pull request #195 from firmfirm/master
Add HTML imports entry-point
2016-11-04 22:54:47 +07:00
Martynas
c71373b666 Add HTML imports entry-point 2016-11-03 19:50:51 +02:00
Faisal Salman
bf4c2e170e Fix #174: "Tablet PC" != tablet device 2016-10-29 00:39:20 +07:00
Faisal Salman
51b8089958 Merge pull request #191 from kennynaoh/master
Add CDNJS version badge in readme
2016-10-22 06:43:57 +07:00
naoh
550420d725 Add CDNJS version badge in readme
This will add the badge to show its version on CDNJS and also link to its page on CDNJS!
2016-10-18 17:10:36 +08:00
Faisal Salman
fbcfe248b8 Merge pull request #172 from fcamblor/patch-1
Fixed require sample in readme
2016-09-29 19:50:50 +07:00
Faisal Salman
2a5cd4d119 Merge pull request #179 from leipert/patch-1
rewrote license field to be SPDX compatible
2016-09-29 19:49:48 +07:00
Lithin
c3f7294a44 Add device detection for HP 10 tablet 2016-05-26 19:01:11 +05:30
Lukas Eipert
b254f93ec1 rewrote license field to be SPDX compatible
According to [NPM docs](https://docs.npmjs.com/files/package.json#license) the `license` field in package.json should be SPDX compatible.

[SPDX](https://spdx.org/licenses/) is a format which allows you to specify your licenses in an easy understandable, machine parseable way.

These changes reflect your license choice according to #1
2016-05-23 11:33:12 +02:00
Benjamin Urban
1020d10a30 Add generic device detection for samsung smartphones 2016-03-22 15:08:11 +01:00
Frédéric Camblor
5ba9fd50ed Fixed require sample in readme
Module name is `ua-parser-js`, not `ua-parser` (see [here](d929c3e508/src/ua-parser.js (L855)))
2016-03-17 18:03:33 +01:00
philippsimon
bb69ef2bd4 Get SmartTV device by HbbTV part 2016-02-26 18:53:43 +01:00
Faisal Salman
3a457f9bd9 Merge pull request #136 from malash/fix/util-extend
Rewrite util.extend to a clone version
2016-02-25 10:54:54 +07:00
Malash
d929c3e508 Merge branch 'master' into fix/util-extend
* master:
  Meteor fixes
  fix it for opera mini 8 above on iphone
  Add name to UA-Parser
  Fix image #150
  Increment build version: 0.7.10
  Check for tablet first
  Fix #153 mistaken Search phrase for Arch OS
  Seems to fix the issue for specific UA found in #159
  UAParser is exposed globally to the window object. It can be used directly.
  Fix detection of Firefox on iOS.
  Added hasOwnProperty check
  Generalize the check for an unidentifiable mobile or tablet to correctly categorize unidentifiable Android smartphones as "mobile".
  travis update: node_js stable, cache node_modules, sudo false
  Detect Nexus 6 as Motorola only.
  Add Playstation 4 support.
  Added Nexus 6 detection
  Added DEVICE regular expressions for "Samsung galaxy S6" and "Samsung Galaxy S6 Edge" devices + test cases
  Adding PhantomJS (http://phantomjs.org/)
  Add Sleipnir
2016-02-22 15:15:09 +08:00
Faisal Salman
0d42b3a752 Merge pull request #163 from jobrapido/develop
Optimized Android browser regex patterns
2016-02-21 22:47:04 +07:00
Faisal Salman
1ec2119288 Merge pull request #160 from gryphon/master
Add name to UA-Parser RequireJS module
2016-02-21 22:46:56 +07:00
Andrea Vaghi
4344c43d04 run build 2016-01-28 11:05:27 +01:00
Andrea Vaghi
909d6fc26d Optimized pattern for Android browser, moved them before the Chrome pattern to avoid errors in the some of the newest browsers 2016-01-28 11:01:05 +01:00
Faisal Salman
8e46a85549 Merge pull request #162 from cesarve77/patch-1
Meteor fixes
2016-01-07 09:11:13 +07:00
Faisal Salman
1f92d6148c Merge pull request #161 from yupmin/opera-mini-8-above-iphone
fix it for opera mini 8 above on iphone
2016-01-07 09:10:02 +07:00
CESAR RAMOS
5d57850074 Meteor fixes 2016-01-03 21:23:20 -04:30
Yun Young-jin
8e81811dea fix it for opera mini 8 above on iphone
https://dev.opera.com/blog/opera-mini-8-for-ios/
2015-12-30 12:00:33 +09:00
Grigory Dmitrenko
99a80e88fb Add name to UA-Parser 2015-12-23 14:10:37 +03:00
Faisal Salman
cbba2f5728 Fix image #150 2015-12-12 18:26:40 +07:00
niris
2e5dff95c8 add support for wechat 2015-11-03 16:05:37 +08:00
Malash
792dc0246a Rewrite util.extend to a clone version 2015-10-10 15:53:17 +08:00
71 changed files with 19641 additions and 4463 deletions

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

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: faisalman
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/']

43
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Library version**
Which version of the library that you use, eg: v0.7.35 or v2.0.0-alpha.3
For the issue related with detection result, you can use the demo section in https://uaparser.js.org to confirm
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1 @@
- [ ] I have read and accept the [Contributor License Agreement (CLA)](https://gist.github.com/faisalman/2ed16621ebb544157eba85a7f7381417) Document and I hereby sign the CLA

78
.github/workflows/analysis-codeql.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: CodeQL Analysis
on:
push:
branches: [ "master"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '15 6 * * 0'
permissions: read-all
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

View File

@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: Dependency Analysis
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2

View File

@@ -0,0 +1,72 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: OpenSSF's Scorecard Analysis
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '45 2 * * 4'
push:
branches: [ "master" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
with:
sarif_file: results.sarif

View File

@@ -0,0 +1,22 @@
name: Publish to GitHub Package
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,23 @@
name: Publish to NPM
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

23
.github/workflows/test-ci.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: UAParser.js CI-Test
on: [push, pull_request]
permissions:
contents: read
jobs:
run-test:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Run the test
run: |
npm ci
npx playwright install
npm test

10
.gitignore vendored
View File

@@ -1,5 +1,8 @@
node_modules/
npm-debug.log
playwright-report/
test-results/
### vim ###
.*.s[a-w][a-z]
*.un~
@@ -8,17 +11,20 @@ Session.vim
*~
.versions
### editors ###
.vscode
.idea
*.sublime-*
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
.idea

View File

@@ -1,13 +0,0 @@
language: node_js
node_js:
- stable
- "0.10"
notifications:
email: false
cache:
directories:
- node_modules
sudo: false

148
CHANGELOG.md Normal file
View File

@@ -0,0 +1,148 @@
# UAParser.js Changelog
# Version 2.0
- What's breaking:
- Dual-licensed under AGPLv3 or PRO License
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- What's new:
- Some new methods in result object:
- Support for client hints: `withClientHints()`
- Support for feature detection: `withFeatureCheck()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Support for ES module `import { UAParser } from 'ua-parser-js'`
- Provided Enums submodule `'ua-parser-js/enums'`
- Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'`
## Version 2.0.0-beta.3
- Breaking:
- AR/VR devices moved to new device type: `xr`
- New property in `browser`: `type`
- In `ua-parser-js/extensions` submodule, `bots` divided into `crawler` / `fetcher`
- New features:
- Parse directly from command line using `npx ua-parser-js`
- Extensions can be passed as a list to `UAParser()`
- Add new browser: Pico Browser, Twitter, Wolvic
- Improve browser detection: DuckDuckGo, ICEBrowser, Klar, QQ, Sleipnir
- Improve device detection: Oculus Quest & Oppo Pad
- Update latest client hints spec: `formFactor` -> `formFactors`
## Version 2.0.0-beta.2
- Increase UA_MAX_LENGTH to 500
- Add TypeScript declaration file in `ua-parser-js/extensions` submodule
- Improve TypeScript module resolution
- Add new methods in `ua-parser-js/helpers` submodule: `isAppleSilicon()` & `isChromiumBased()`
- Fix misidentified WebView token as device model
- Add new browser: Alipay, Klarna, Opera GX, Smart Lenovo Browser, Vivo Browser
- Rename browser: Avant, Baidu, Samsung Internet, Sogou Explorer, Sogou Mobile, WeChat
- Improve client-hints detection: Edge, Xbox
## Version 2.0.0-beta.1
- Update Client Hints Form-Factor
- Provide in-package type definitions
- Add new device: Ulefone
- Improve device detection: Realme, Xiaomi Redmi
## Version 2.0.0-alpha.3
- Add `withFeatureCheck()` method
- Add `isFrozenUA()` method in `ua-parser-js/helpers` submodule
- Add `MediaPlayers` & `Modules` in `ua-parser-js/extensions` submodule
- Fix issue with ESM import
## Version 2.0.0-alpha.2
- Fix browser result always returning Chromium when using withClientHints()
- Fix infinite-loop when await-ing withClientHints() in non-client-hints browser
## Version 2.0.0-alpha.1
- Initial work on new major version
# 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
- 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.

29
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,29 @@
# UAParser.js Code of Conduct
## Introduction
Welcome to the UAParser.js community! We're here to collaborate on developing an awesome project. Here are some general guidelines to make our community a great place:
### 1. Be Kind, Honest, and Respectful
Always treat others with kindness and respect. We value different opinions and encourage positive communication.
### 2. Keep Conversations Civil and On-Topic
Please keep discussions related to the project. If you want to talk about something else, find the right place for it.
### 3. Mutual Assistance, Appreciation, and Acknowledgement
Feel free to ask for help, show gratitude for contributions, and make sure to give credit where it's due.
### 4. Resolving Disagreements
In the event of a disagreement, we encourage open and respectful dialogue. It's important to remember that it's okay to have differing opinions, and if a common ground can't be reached, we suggest using the 'agree to disagree' approach.
## Reporting Issues
If you see any behavior that goes against this code of conduct, report it to [f@faisalman.com](mailto:f@faisalman.com).
## Conclusion
Together, we can make this project awesome!

7
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,7 @@
# UAParser.js: How to Contribute
* Fork and clone this repository
* Make some changes as required
* Write unit test to showcase its functionality under `/test`
* Run the test suites to make sure it's not breaking anything `$ npm run build+test`
* Submit a pull request under `develop` branch & check the CLA in the submission form

71
LICENSE.md Normal file
View File

@@ -0,0 +1,71 @@
# UAPARSER.JS PRO BUSINESS LICENSE
Version 2, July 2024
Copyright (C) 2023-2024 Faisal Salman <f+ua-parser-js@faisalman.com>
---
## Definitions
"We" are the team behind UAParser.js.
"You" are the individual, organization, or company who is responsible for purchasing this license.
"The Code" is UAParser.js.
"Project" is what you built with The Code.
---
## License
We retain all title, intellectual property, and ownership rights to The Code.
The Code is licensed, not sold, to You for use solely subject to the terms and conditions detailed here.
We grant You (and only You) a limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code.
This license is only valid for You as one (1) individual, organization, or company and cannot be transferred to another individual, organization, or company.
---
## Rights
You may use and modify The Code only in one (1) Project. If you use it in more than one (1) Project, you must purchase another license.
If You transfer a Project to a client, the use of The Code must be limited to the original functionality that You created for them. The Code must not be extracted, reproduced, or used in any other way. You must inform your client of this condition.
You have the right to receive lifetime updates and one (1) year of support, starting from the time you make the purchase.
---
## Restrictions
You may not redistribute The Code, as-is or modified, except as a part of a Project that you made.
You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purposes by the general public, except with our written consent.
You may not use The Code for unlawful, inappropriate, illegal, or offensive purposes.
---
## Limitations
The Code is provided 'as is' without warranty of any kind, expressed or implied.
We shall not be liable for any damages, including but not limited to, direct, indirect, special, incidental, or consequential damages or losses that occur by the use of The Code.
We reserve the right to discontinue the lifetime updates for The Code at any time, with or without notice.
We offer support only for questions within the scope of The Code's functionality or related issues at our sole discretion.
---
## Termination
This license is effective indefinitely but can be revoked at any time if there is a violation of any of the terms.
---
END OF TERMS AND CONDITIONS

22
PULL_REQUEST_TEMPLATE.md Normal file
View File

@@ -0,0 +1,22 @@
# Prerequisites
- [ ] I have read and follow the contributing guidelines
- [ ] I have read and accept the [Contributor License Agreement (CLA)](https://gist.github.com/faisalman/2ed16621ebb544157eba85a7f7381417) Document and I hereby sign the CLA
# Type of Change
Bug fix, feature, docs update, ...
# Description
Please include a summary of the change (current behavior vs new behavior), which issue is fixed (you can also link to an open issue here), and why this change is necessary.
# Test
Please describe the tests that you ran to verify your changes.
# Impact
Does this PR introduce a breaking change? What changes might users need to make due to this PR?
# Other Info

23
README.md Normal file
View File

@@ -0,0 +1,23 @@
<p align="center">
<a href="https://uaparser.dev"><img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/uap-header.png"></a>
</p>
# UAParser.js
Thank you for purchasing UAParser.js PRO Business License, if you haven't please order here: https://store.faisalman.com
# Download
```sh
npm install @ua-parser-js/pro-business
```
# Documentation
https://docs.uaparser.dev
# License
UAParser.js PRO Business
Copyright (c) 2012-2024 Faisal Salman <<f@faisalman.com>>

7
SECURITY.md Normal file
View File

@@ -0,0 +1,7 @@
# Security Policy
## Reporting a Vulnerability
To report a security issue, please email `f@faisalman.com` with a description of the issue, reproducible steps to get the issue, affected versions, and, if known, mitigations for the issue.
If the issue is confirmed as a vulnerability, we will open a new security advisory draft in our GitHub's Security Advisory page [https://github.com/faisalman/ua-parser-js/security/advisories](https://github.com/faisalman/ua-parser-js/security/advisories) and acknowledge your contributions as part of it. This project follows a 90 days disclosure timeline.

View File

@@ -1,43 +0,0 @@
{
"name": "ua-parser-js",
"version": "0.7.10",
"authors": [
"Faisal Salman <fyzlman@gmail.com>"
],
"private": false,
"main": "src/ua-parser.js",
"ignore": [
"build",
"node_modules",
"bower_components",
"test",
"tests"
],
"contributors": [
"Faisal Salman <fyzlman@gmail.com>",
"Benjamin Bertrand <bertrand.design@gmail.com>",
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
"Christopher De Cairos <chris.decairos@gmail.com>",
"Davit Barbakadze <jayarjo@gmail.com>",
"Dmitry Tyschenko <dtyschenko@gmail.com>",
"Douglas Li <doug@knotch.it>",
"Dumitru Uzun <duzun@mail.ru>",
"Erik Hesselink <hesselink@gmail.com>",
"Fabian Becker <halfdan@xnorfz.de>",
"Hendrik Helwich <h.helwich@iplabs.de>",
"Jackpoll <jackpoll123456@gmail.com>",
"Jake Mc <startswithaj@users.noreply.github.com>",
"John Tantalo <john.tantalo@gmail.com>",
"John Yanarella <jmy@codecatalyst.com>",
"Jon Buckley <jon@jbuckley.ca>",
"Kendall Buchanan <kendall@kendagriff.com>",
"Lee Treveil <leetreveil@gmail.com>",
"Leonardo <leofiore@libero.it>",
"Max Maurer <maxemanuel.maurer@gmail.com>",
"Michael Hess <mhess@connectify.me>",
"OtakuSiD <otakusid@gmail.com>",
"Ross Noble <rosshnoble@gmail.com>",
"Sandro Sonntag <sandro.sonntag@adorsys.de>"
],
"dependencies": {}
}

View File

@@ -1,24 +0,0 @@
{
"name": "ua-parser-js",
"version": "0.7.10",
"description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [
"user-agent",
"parser",
"browser",
"engine",
"os",
"device",
"cpu"
],
"scripts": [
"src/ua-parser.js"
],
"main": "src/ua-parser.js",
"license": "MIT",
"development": {
"jshint/jshint": "*",
"visionmedia/mocha": "*",
"mishoo/uglifyjs2": "*"
}
}

1
dist/ua-parser.html vendored Normal file
View File

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

12
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

4962
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

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

255
package.json Normal file → Executable file
View File

@@ -1,91 +1,256 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.7.10",
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
"description": "Lightweight JavaScript-based user-agent string parser",
"title": "UAParser.js PRO Business",
"name": "@ua-parser-js/pro-business",
"version": "2.0.0-beta.3",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
"keywords": [
"user-agent",
"client-hints",
"parser",
"browser",
"engine",
"os",
"device",
"cpu"
"cpu",
"jquery-plugin",
"ecosystem:jquery",
"ua-parser-js",
"browser-detection",
"device-detection",
"os-detection",
"bot-detection"
],
"homepage": "http://github.com/faisalman/ua-parser-js",
"homepage": "https://github.com/faisalman/ua-parser-js",
"contributors": [
"Faisal Salman <fyzlman@gmail.com>",
"Aamir Poonawalla <aamir@urx.com>",
"Admas <mollases@users.noreply.github.com>",
"algenon <m@antonz.ru>",
"Alvin Portillo <alvin@8thwall.com>",
"Amumu <yoyo837@hotmail.com>",
"Andrea Vaghi <andrea.vaghi@jobrapido.com>",
"Anton Zhiyanov <m@antonz.ru>",
"Arturo Mejia <amejia@blim.com>",
"Arun Rama Reddy <arunramareddy@gmail.com>",
"Austin Pray <austin@austinpray.com>",
"Bendeguz <symunona@gmail.com>",
"Benjamin Bertrand <bertrand.design@gmail.com>",
"Benjamin Urban <benjamin.urban@sueddeutsche.de>",
"boneyao <admin@boneyao.com>",
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
"CESAR RAMOS <c@imagenproactiva.com>",
"Chad Killingsworth <ckillingsworth@jackhenry.com>",
"chenhui9279 <chenhui9279@autohome.com.cn>",
"chenyuan-new <53860479+chenyuan-new@users.noreply.github.com>",
"Christopher De Cairos <chris.decairos@gmail.com>",
"Cyrille David <cyrille@qonto.eu>",
"Dante <duanjl.china@gmail.com>",
"Dario Vladovic <d.vladimyr@gmail.com>",
"David Annez <david.annez@gmail.com>",
"Davit Barbakadze <jayarjo@gmail.com>",
"ddivernois <david-emmanuel.divernois@amadeus.com>",
"Deliaz <D3liaz@gmail.com>",
"Demis Palma <demis.palma@gmail.com>",
"dhoko <aurelien@protonmail.com>",
"dianhe <dianhe@webank.com>",
"dineshks1 <dineshks1@d.kumar44@outlook.com>",
"Dmitry Tyschenko <dtyschenko@gmail.com>",
"Douglas Li <doug@knotch.it>",
"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>",
"Erik Hesselink <hesselink@gmail.com>",
"Fabian Becker <halfdan@xnorfz.de>",
"Faisal Salman <f@faisalman.com>",
"Frédéric Camblor <fcamblor@gmail.com>",
"Frederik Ring <frederik.ring@gmail.com>",
"Garrit Franke <garrit@slashdev.space>",
"Gerald Host <me@jacobford.co.uk>",
"Germán M. Bravo <german.mb@gmail.com>",
"Grigory Dmitrenko <grigory@snsk.ru>",
"gulpin <gulping.gulpin@gmail.com>",
"Hans Ott <hansott@hotmail.be>",
"Hendrik Helwich <h.helwich@iplabs.de>",
"Jackpoll <jackpoll123456@gmail.com>",
"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>",
"Jacky Choo <jackychoo@adly-macbook.local>",
"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 Yanarella <jmy@codecatalyst.com>",
"Jon Buckley <jon@jbuckley.ca>",
"Josh Goldberg <joshuakgoldberg@outlook.com>",
"Junki-Ishida <junki_ishida@dwango.co.jp>",
"Kendall Buchanan <kendall@kendagriff.com>",
"KnifeLemon <role___play@naver.com>",
"kNoAPP <alldoneb@gmail.com>",
"Lee Treveil <leetreveil@gmail.com>",
"Leonardo <leofiore@libero.it>",
"leonardo <leofiore@libero.it>",
"Levente Balogh <balogh.levente.hu@gmail.com>",
"Liam Quinn <lquinn@blackberry.com>",
"Lithin <lithin@webklipper.com>",
"liujunlve <liujunlve@henhaoji.com>",
"ll-syber <670159357@qq.com>",
"Loris Guignard <loris.guignard@gmail.com>",
"Lukas Drgon <lukas.drgon@gmail.com>",
"Lukas Eipert <leipert@users.noreply.github.com>",
"Malash <i@malash.me>",
"Martynas <martynas@firmfirm.co>",
"Masahiko Sato <masasato@yahoo-corp.jp>",
"Matt Brophy <matt@brophy.org>",
"Matthew Origer <karatecowboy@gmail.com>",
"Maximilian Haupt <mail@maximilianhaupt.com>",
"Max Maurer <maxemanuel.maurer@gmail.com>",
"Max Nordlund <max.nordlund@gmail.com>",
"Michael Hess <mhess@connectify.me>",
"OtakuSiD <otakusid@gmail.com>",
"MimyyK <michele.marais@hakisa.com>",
"Mok <mok@moekm.com>",
"nabetama <mao.nabeta@gmail.com>",
"naoh <naoh.cs03g@nctu.edu.tw>",
"Nicholas Ionata <nionata@ufl.edu>",
"Nikhil Motiani <nikhil.motiani@outlook.com>",
"Nik Rolls <nik@rolls.cc>",
"nionata <n.ionata129@gmail.com>",
"niris <nirisix@gmail.com>",
"Nobuo Okada <nookada@yahoo-corp.jp>",
"o.drapeza <o.drapeza@tinkoff.ru>",
"Oscar Becerra <oscarbecerra@google.com>",
"otakuSiD <otakusid@gmail.com>",
"Paris Morgan <paris@8thwall.com>",
"patrick-nurt <github@pereira.dk>",
"Pavel Studeny <studeny@avast.com>",
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
"philippsimon <github@philippsimon.de>",
"Pieter Hendrickx <pieter.hendrickx@belfius.be>",
"Piper Chester <piperchester@gmail.com>",
"Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>",
"Raine Makelainen <raine.makelainen@jolla.com>",
"Raman Savaryn <homeneartheocean@gmail.com>",
"Riley Shaw <rileyjshaw@users.noreply.github.com>",
"Robert Tod <robert@qubit.com>",
"roman.savarin <roman.savarin@skywindgroup.com>",
"Ron Korland <ron@testim.io>",
"Ross Noble <rosshnoble@gmail.com>",
"Sandro Sonntag <sandro.sonntag@adorsys.de>"
"ruicong <466403866@qq.com>",
"Runar Heggset <rukki093@gmail.com>",
"Ryohei Shima <shima01dev@gmail.com>",
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
"sgautrea <shanegautreau@gmail.com>",
"shaharmor <shahar@peer5.com>",
"Shane Gautreau <sgautrea@opentext.com>",
"Shane Thacker <shane@steadymade.com>",
"Shreedhar <shreedhar@uber.com>",
"Simon Eisenmann <simon@longsleep.org>",
"Simon Lang <me@simonlang.org>",
"Stiekel <histkc@gmail.com>",
"sunny-mwx <30586210+sunny-mwx@users.noreply.github.com>",
"sUP <dani3l@gmail.com>",
"Sylvain Gizard <sylvain.gizard@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>",
"Varun Sharma <varunsh@stepsecurity.io>",
"XhmikosR <xhmikosr@gmail.com>",
"Yılmaz <yilmazdemir36@gmail.com>",
"yuanyang <work_yuanyang@163.com>",
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
"Zach Bjornson <zbbjornson@gmail.com>",
"Ziding Zhang <zidingz@gmail.com>"
],
"main": "src/ua-parser.js",
"scripts": {
"build": "uglifyjs src/ua-parser.js > dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js > dist/ua-parser.pack.js --comments '/UAParser\\.js/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
"verup": "node ./node_modules/verup",
"version": "node ./node_modules/verup 0"
"type": "commonjs",
"types": "src/main/ua-parser.d.ts",
"main": "src/main/ua-parser.js",
"module": "src/main/ua-parser.mjs",
"browser": "dist/ua-parser.pack.js",
"exports": {
".": {
"require": "./src/main/ua-parser.js",
"import": "./src/main/ua-parser.mjs",
"types": "./src/main/ua-parser.d.ts"
},
"./enums": {
"require": "./src/enums/ua-parser-enums.js",
"import": "./src/enums/ua-parser-enums.mjs"
},
"./extensions": {
"require": "./src/extensions/ua-parser-extensions.js",
"import": "./src/extensions/ua-parser-extensions.mjs",
"types": "./src/extensions/ua-parser-extensions.d.ts"
},
"./helpers": {
"require": "./src/helpers/ua-parser-helpers.js",
"import": "./src/helpers/ua-parser-helpers.mjs",
"types": "./src/helpers/ua-parser-helpers.d.ts"
}
},
"verup": {
"files": [
"ua-parser-js.jquery.json",
"component.json",
"bower.json",
"package.js",
"src/ua-parser.js"
],
"regs": [
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
"^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
]
"files": [
"dist",
"src"
],
"bin": "./script/cli.js",
"scripts": {
"build": "./script/build-dist.sh && ./script/build-module.js",
"build+test": "npm run build && npm run test",
"fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync",
"test": "./script/test-all.sh",
"test:dts-lint": "tsd --typings src/main/ua-parser.d.ts --files test/dts-test.ts",
"test:eslint": "eslint src && eslint script",
"test:jshint": "jshint src/main",
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
"test:mocha": "mocha test/mocha*js",
"test:playwright": "playwright test"
},
"devDependencies": {
"jshint": "~1.1.0",
"mocha": "~1.8.0",
"uglify-js": "~1.3.4",
"verup": "^1.3.x"
"@babel/parser": "7.15.8",
"@babel/traverse": "7.23.2",
"@jazzer.js/core": "^1.4.0",
"@playwright/test": "~1.32.2",
"jshint": "~2.13.6",
"mocha": "~8.2.0",
"requirejs": "2.3.2",
"safe-regex": "^2.1.1",
"tsd": "^0.29.0",
"uglify-js": "~3.12.0"
},
"repository": {
"type": "git",
"url": "https://github.com/faisalman/ua-parser-js.git"
},
"licenses": [
{
"type": "GPLv2",
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
},
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"license": "UAParser.js-PRO-Business",
"engines": {
"node": "*"
},
"directories": {
"dist": "dist",
"script": "script",
"src": "src",
"test": "test"
}
},
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
"demo": "https://uaparser.js.org",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.pack.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"
}
]
}

281
readme.md
View File

@@ -1,281 +0,0 @@
# UAParser.js
Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as jQuery/Zepto plugin, Component/Bower/Meteor package, & RequireJS/AMD module
[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master)](https://travis-ci.org/faisalman/ua-parser-js)
[![Flattr this](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/3867907/faisalmanua-parser-js-on-GitHub)
* Author : Faisal Salman <<fyzlman@gmail.com>>
* Demo : http://faisalman.github.io/ua-parser-js
* Source : https://github.com/faisalman/ua-parser-js
## Features
Extract detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model purely from user-agent string with relatively lightweight footprint (~11KB minified / ~4KB gzipped). Written in vanilla js, which means it doesn't depends on any other library.
![It's over 9000](https://pbs.twimg.com/media/A9LpEG6CIAA5VrT.jpg)
## Methods
* `getBrowser()`
* returns `{ name: '', version: '' }`
```
# Possible 'browser.name':
Amaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Camino, Chimera, Chrome,
Chromium, Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Edge, Epiphany, Fennec,
Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDragon,
Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links,
Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari,
Mosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet],
PhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser,
Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, Yandex
# 'browser.version' determined dynamically
```
* `getDevice()`
* returns `{ model: '', type: '', vendor: '' }`
```
# Possible 'device.type':
console, mobile, tablet, smarttv, wearable, embedded
# Possible 'device.vendor':
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone,
Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian,
Nintendo, Nokia, Nvidia, Ouya, Palm, Panasonic, Polytron, RIM, Samsung, Sharp,
Siemens, Sony-Ericsson, Sprint, Xbox, ZTE
# 'device.model' determined dynamically
```
* `getEngine()`
* returns `{ name: '', version: '' }`
```
# Possible 'engine.name'
Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto,
Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically
```
* `getOS()`
* returns `{ name: '', version: '' }`
```
# Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat,
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk
# 'os.version' determined dynamically
```
* `getCPU()`
* returns `{ architecture: '' }`
```
# Possible 'cpu.architecture'
68k, amd64, arm, arm64, avr, ia32, ia64, irix, irix64, mips, mips64, pa-risc,
ppc, sparc, sparc64
```
* `getResult()`
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
* `getUA()`
* returns UA string of current instance
* `setUA(uastring)`
* set & parse UA string
## Example
```html
<!doctype html>
<html>
<head>
<script type="text/javascript" src="ua-parser.min.js"></script>
<script type="text/javascript">
var parser = new UAParser();
// by default it takes ua string from current browser's window.navigator.userAgent
console.log(parser.getResult());
/*
/// this will print an object structured like this:
{
ua: "",
browser: {
name: "",
version: ""
},
engine: {
name: "",
version: ""
},
os: {
name: "",
version: ""
},
device: {
model: "",
type: "",
vendor: ""
},
cpu: {
architecture: ""
}
}
*/
// let's test a custom user-agent string as an example
var uastring = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 Chrome/15.0.874.106 Safari/535.2";
parser.setUA(uastring);
var result = parser.getResult();
// this will also produce the same result (without instantiation):
// var result = UAParser(uastring);
console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"}
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
console.log(result.os.version); // "11.10"
console.log(result.engine.name); // "WebKit"
console.log(result.cpu.architecture); // "amd64"
// do some other tests
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)";
console.log(parser.setUA(uastring2).getBrowser().name); // "Konqueror"
console.log(parser.getOS()); // {name: "OpenBSD", version: undefined}
console.log(parser.getEngine()); // {name: "KHTML", version: "4.1.4"}
var uastring3 = 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Version/7.1.0.7 Safari/534.11';
console.log(parser.setUA(uastring3).getDevice().model); // "PlayBook"
console.log(parser.getOS()) // {name: "RIM Tablet OS", version: "1.0.0"}
console.log(parser.getBrowser().name); // "Safari"
</script>
</head>
<body>
</body>
</html>
```
### Using node.js
```sh
$ npm install ua-parser-js
```
```js
var http = require('http');
var parser = require('ua-parser-js');
http.createServer(function (req, res) {
// get user-agent header
var ua = parser(req.headers['user-agent']);
// write the result as response
res.end(JSON.stringify(ua, null, ' '));
})
.listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
```
### Using requirejs
```js
require(['ua-parser'], function(UAParser) {
var parser = new UAParser();
console.log(parser.getResult());
});
```
### Using component
```sh
$ component install faisalman/ua-parser-js
```
### Using bower
```sh
$ bower install ua-parser-js
```
### Using meteor
```sh
$ meteor add faisalman:ua-parser-js
```
### Using jQuery/Zepto ($.ua)
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
```js
// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
// Do some tests
console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"}
console.log($.ua.os); // {name: "Android", version: "2.3.4"}
console.log($.ua.os.name); // "Android"
console.log($.ua.get()); // "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0"
// reset to custom user-agent
$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13');
// Test again
console.log($.ua.browser.name); // "Safari"
console.log($.ua.engine.name); // "Webkit"
console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"}
console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4
```
### Extending regex patterns
* `UAParser(uastring[, extensions])`
Pass your own regexes to extend the limited matching rules.
```js
// Example:
var uaString = 'ownbrowser/1.3';
var ownBrowser = [[/(ownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
var parser = new UAParser(uaString, {browser: ownBrowser});
console.log(parser.getBrowser()); // {name: "ownbrowser", version: "1.3"}
```
## Development
Verify, test, & minify script
```sh
$ npm run test
$ npm run build
```
Then submit a pull request to https://github.com/faisalman/ua-parser-js under `develop` branch.
## License
Dual licensed under GPLv2 & MIT
Copyright © 2012-2015 Faisal Salman <<fyzlman@gmail.com>>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

13
script/build-dist.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
SRC_PATH="src/main/ua-parser.js"
MIN_PATH="dist/ua-parser.min.js"
PACK_PATH="dist/ua-parser.pack.js"
# minified
echo "Generate ${MIN_PATH}"
uglifyjs $SRC_PATH -o $MIN_PATH --comments "/^ UA/"
# packed
echo "Generate ${PACK_PATH}"
uglifyjs $SRC_PATH -o $PACK_PATH --comments "/^ UA/" --compress --mangle

58
script/build-module.js Executable file
View File

@@ -0,0 +1,58 @@
#!/usr/bin/env node
/* jshint esversion: 6 */
const fs = require('fs');
const generateMJS = (module) => {
let { src, dest, title, replacements } = module;
let text = fs.readFileSync(src, 'utf-8');
replacements.push(
[/const (.+?)\s*=\s*require\((.+)\)/ig, 'import $1 from $2'],
[/module\.exports =/ig, 'export']
);
replacements.forEach(rep => {
text = text.replace(rep[0], rep[1]);
});
console.log(`Generate ${dest}`);
fs.writeFileSync(dest,
`// Generated ESM version of ${title}
// DO NOT EDIT THIS FILE!
// Source: /${src}
${text}`, 'utf-8');
};
const modules = [
{
src : 'src/main/ua-parser.js',
dest : 'src/main/ua-parser.mjs',
title : 'ua-parser-js',
replacements : [
[/\(func[\s\S]+strict\';/ig, ''],
[/esversion\: 3/ig, 'esversion: 6'],
[/\/[\/\s]+export[\s\S]+/ig,'export {UAParser};']
]
},{
src : 'src/enums/ua-parser-enums.js',
dest :'src/enums/ua-parser-enums.mjs',
title : 'ua-parser-js/enums',
replacements : []
},
{
src : 'src/extensions/ua-parser-extensions.js',
dest : 'src/extensions/ua-parser-extensions.mjs',
title : 'ua-parser-js/extensions',
replacements : []
},
{
src : 'src/helpers/ua-parser-helpers.js',
dest : 'src/helpers/ua-parser-helpers.mjs',
title : 'ua-parser-js/helpers',
replacements : []
}
];
modules.forEach(module => generateMJS(module));

4
script/cli.js Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
const UAParser = require('ua-parser-js');
console.log(JSON.stringify(process.argv.slice(2).map(ua => UAParser(ua)), null, 4));

32
script/test-all.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
echo '
- run build
'
npm run build || exit 1
echo '
- lint js code
'
npm run test:jshint || exit 1
#npm run test:eslint || exit 1
echo '
- test using mocha
'
npm run test:mocha || exit 1
echo '
- test using playwright
'
npm run test:playwright || exit 1
echo '
- lint lockfile
'
npm run test:lockfile-lint || exit 1
echo '
- lint d.ts files
'
npm run test:dts-lint || exit 1

View File

@@ -0,0 +1,363 @@
///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Business License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const Browser = Object.freeze({
_2345_EXPLORER: '2345Explorer',
_360: '360 Browser',
ALIPAY: 'Alipay',
AMAYA: 'Amaya',
ANDROID: 'Android Browser',
ARORA: 'Arora',
AVANT: 'Avant',
AVAST: 'Avast Secure Browser',
AVG: 'AVG Secure Browser',
BAIDU: 'Baidu Browser',
BASILISK: 'Basilisk',
BLAZER: 'Blazer',
BOLT: 'Bolt',
BOWSER: 'Bowser',
BRAVE: 'Brave',
CAMINO: 'Camino',
CHIMERA: 'Chimera',
CHROME: 'Chrome',
CHROME_HEADLESS: 'Chrome Headless',
CHROME_MOBILE: 'Mobile Chrome',
CHROME_WEBVIEW: 'Chrome WebView',
CHROMIUM: 'Chromium',
COBALT: 'Cobalt',
COC_COC: 'Coc Coc',
COMODO_DRAGON: 'Comodo Dragon',
CONKEROR: 'Conkeror',
DILLO: 'Dillo',
DOLPHIN: 'Dolphin',
DORIS: 'Doris',
DUCKDUCKGO: 'DuckDuckGo',
EDGE: 'Edge',
EPIPHANY: 'Epiphany',
FACEBOOK: 'Facebook',
FALKON: 'Falkon',
FIREBIRD: 'Firebird',
FIREFOX: 'Firefox',
FIREFOX_FOCUS: 'Firefox Focus',
FIREFOX_MOBILE: 'Mobile Firefox',
FIREFOX_REALITY: 'Firefox Reality',
FENNEC: 'Fennec',
FLOCK: 'Flock',
FLOW: 'Flow',
GO: 'GoBrowser',
GOOGLE_SEARCH: 'GSA',
HEYTAP: 'HeyTap',
HUAWEI: 'Huawei Browser',
ICAB: 'iCab',
ICE: 'ICE Browser',
ICEAPE: 'IceApe',
ICECAT: 'IceCat',
ICEDRAGON: 'IceDragon',
ICEWEASEL: 'IceWeasel',
IE: 'IE',
INSTAGRAM: 'Instagram',
IRIDIUM: 'Iridium',
IRON: 'Iron',
JASMINE: 'Jasmine',
KONQUEROR: 'Konqueror',
KAKAO: 'KakaoTalk',
KHTML: 'KHTML',
K_MELEON: 'K-Meleon',
KLAR: 'Klar',
KLARNA: 'Klarna',
KINDLE: 'Kindle',
LENOVO: 'Smart Lenovo Browser',
LIEBAO: 'LBBROWSER',
LINE: 'Line',
LINKEDIN: 'LinkedIn',
LINKS: 'Links',
LUNASCAPE: 'Lunascape',
LYNX: 'Lynx',
MAEMO: 'Maemo Browser',
MAXTHON: 'Maxthon',
MIDORI: 'Midori',
MINIMO: 'Minimo',
MIUI: 'MIUI Browser',
MOZILLA: 'Mozilla',
MOSAIC: 'Mosaic',
NAVER: 'Naver',
NETFRONT: 'NetFront',
NETSCAPE: 'Netscape',
NETSURF: 'Netsurf',
NOKIA: 'Nokia Browser',
OBIGO: 'Obigo',
OCULUS: 'Oculus Browser',
OMNIWEB: 'OmniWeb',
OPERA: 'Opera',
OPERA_COAST: 'Opera Coast',
OPERA_MINI: 'Opera Mini',
OPERA_MOBI: 'Opera Mobi',
OPERA_TABLET: 'Opera Tablet',
OPERA_TOUCH: 'Opera Touch',
OVI: 'OviBrowser',
PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
PICOBROWSER: 'Pico Browser',
POLARIS: 'Polaris',
PUFFIN: 'Puffin',
QQ: 'QQBrowser',
QQ_LITE: 'QQBrowserLite',
QUARK: 'Quark',
QUPZILLA: 'QupZilla',
REKONQ: 'rekonq',
ROCKMELT: 'Rockmelt',
SAFARI: 'Safari',
SAFARI_MOBILE: 'Mobile Safari',
SAILFISH: 'Sailfish Browser',
SAMSUNG: 'Samsung Internet',
SEAMONKEY: 'SeaMonkey',
SILK: 'Silk',
SKYFIRE: 'Skyfire',
SLEIPNIR: 'Sleipnir',
SLIMBROWSER: 'SlimBrowser',
SNAPCHAT: 'Snapchat',
SOGOU_EXPLORER: 'Sogou Explorer',
SOGOU_MOBILE: 'Sogou Mobile',
SWIFTFOX: 'Swiftfox',
TESLA: 'Tesla',
TIKTOK: 'TikTok',
TIZEN: 'Tizen Browser',
TWITTER: 'Twitter',
UC: 'UCBrowser',
UP: 'UP.Browser',
VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
WATERFOX: 'Waterfox',
WEBKIT: 'WebKit',
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
WOLVIC: 'Wolvic',
YANDEX: 'Yandex'
// TODO : test!
});
const BrowserType = Object.freeze({
CRAWLER: 'crawler',
CLI: 'cli',
EMAIL: 'email',
FETCHER: 'fetcher',
INAPP: 'inapp',
MODULE: 'module'
});
const CPU = Object.freeze({
ARM : 'arm',
ARM_64: 'arm64',
ARM_HF: 'armhf',
AVR: 'avr',
AVR_32: 'avr32',
IA64: 'ia64',
IRIX: 'irix',
IRIX_64: 'irix64',
MIPS: 'mips',
MIPS_64: 'mips64',
M68K: '68k',
PA_RISC: 'pa-risc',
PPC: 'ppc',
SPARC: 'sparc',
SPARC_64: 'sparc64',
X86: 'ia32',
X86_64: 'amd64'
});
const Device = Object.freeze({
CONSOLE: 'console',
DESKTOP: 'desktop',
EMBEDDED: 'embedded',
MOBILE: 'mobile',
SMARTTV: 'smarttv',
TABLET: 'tablet',
WEARABLE: 'wearable',
XR: 'xr'
});
const Vendor = Object.freeze({
ACER: 'Acer',
ALCATEL: 'Alcatel',
APPLE: 'Apple',
AMAZON: 'Amazon',
ARCHOS: 'Archos',
ASUS: 'ASUS',
ATT: 'AT&T',
BENQ: 'BenQ',
BLACKBERRY: 'BlackBerry',
DELL: 'Dell',
ESSENTIAL: 'Essential',
FACEBOOK: 'Facebook',
FAIRPHONE: 'Fairphone',
GEEKSPHONE: 'GeeksPhone',
GENERIC: 'Generic',
GOOGLE: 'Google',
HP: 'HP',
HTC: 'HTC',
HUAWEI: 'Huawei',
INFINIX: 'Infinix',
JOLLA: 'Jolla',
KOBO: 'Kobo',
LENOVO: 'Lenovo',
LG: 'LG',
MEIZU: 'Meizu',
MICROSOFT: 'Microsoft',
MOTOROLA: 'Motorola',
NEXIAN: 'Nexian',
NINTENDO: 'Nintendo',
NOKIA: 'Nokia',
NVIDIA: 'Nvidia',
ONEPLUS: 'OnePlus',
OPPO: 'OPPO',
OUYA: 'Ouya',
PALM: 'Palm',
PANASONIC: 'Panasonic',
PEBBLE: 'Pebble',
POLYTRON: 'Polytron',
REALME: 'Realme',
RIM: 'RIM',
ROKU: 'Roku',
SAMSUNG: 'Samsung',
SHARP: 'Sharp',
SIEMENS: 'Siemens',
SONY: 'Sony',
SPRINT: 'Sprint',
TECHNISAT: 'TechniSAT',
TECNO: 'Tecno',
TESLA: 'Tesla',
ULEFONE: 'Ulefone',
VIVO: 'Vivo',
VODAFONE: 'Vodafone',
XBOX: 'Xbox',
XIAOMI: 'Xiaomi',
ZEBRA: 'Zebra',
ZTE: 'ZTE',
// TODO : test!
});
const Engine = Object.freeze({
AMAYA: 'Amaya',
BLINK: 'Blink',
EDGEHTML: 'EdgeHTML',
FLOW: 'Flow',
GECKO: 'Gecko',
GOANNA: 'Goanna',
ICAB: 'iCab',
KHTML: 'KHTML',
LIBWEB: 'LibWeb',
LINKS: 'Links',
LYNX: 'Lynx',
NETFRONT: 'NetFront',
NETSURF: 'NetSurf',
PRESTO: 'Presto',
TASMAN: 'Tasman',
TRIDENT: 'Trident',
W3M: 'w3m',
WEBKIT: 'WebKit'
});
const OS = Object.freeze({
AIX: 'AIX',
AMIGA_OS: 'Amiga OS',
ANDROID: 'Android',
ANDROID_X86: 'Android-x86',
ARCH: 'Arch',
BADA: 'Bada',
BEOS: 'BeOS',
BLACKBERRY: 'BlackBerry',
CENTOS: 'CentOS',
CHROME_OS: 'Chrome OS',
CHROMECAST: 'Chromecast',
CONTIKI: 'Contiki',
DEBIAN: 'Debian',
DEEPIN: 'Deepin',
DRAGONFLY: 'DragonFly',
ELEMENTARY_OS: 'elementary OS',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
FUCHSIA: 'Fuchsia',
GENTOO: 'Gentoo',
GHOSTBSD: 'GhostBSD',
GNU: 'GNU',
HAIKU: 'Haiku',
HARMONYOS: 'HarmonyOS',
HP_UX: 'HP-UX',
HURD: 'Hurd',
IOS: 'iOS',
JOLI: 'Joli',
KAIOS: 'KaiOS',
LINPUS: 'Linpus',
LINSPIRE: 'Linspire',
LINUX: 'Linux',
MACOS: 'macOS',
MAEMO: 'Maemo',
MAGEIA: 'Mageia',
MANDRIVA: 'Mandriva',
MANJARO: 'Manjaro',
MEEGO: 'MeeGo',
MINIX: 'Minix',
MINT: 'Mint',
MORPH_OS: 'Morph OS',
NETBSD: 'NetBSD',
NETRANGE: 'NetRange',
NETTV: 'NetTV',
NINTENDO: 'Nintendo',
OPENBSD: 'OpenBSD',
OPENVMS: 'OpenVMS',
OS2: 'OS/2',
PALM: 'Palm',
PC_BSD: 'PC-BSD',
PCLINUXOS: 'PCLinuxOS',
PLAN9: 'Plan9',
PLAYSTATION: 'PlayStation',
QNX: 'QNX',
RASPBIAN: 'Raspbian',
REDHAT: 'RedHat',
RIM_TABLET_OS: 'RIM Tablet OS',
RISC_OS: 'RISC OS',
SABAYON: 'Sabayon',
SAILFISH: 'Sailfish',
SERENITYOS: 'SerenityOS',
SERIES40: 'Series40',
SLACKWARE: 'Slackware',
SOLARIS: 'Solaris',
SUSE: 'SUSE',
SYMBIAN: 'Symbian',
TIZEN: 'Tizen',
UBUNTU: 'Ubuntu',
UNIX: 'Unix',
VECTORLINUX: 'VectorLinux',
VIERA: 'Viera',
WATCHOS: 'watchOS',
WEBOS: 'WebOS',
WINDOWS: 'Windows',
WINDOWS_MOBILE: 'Windows Mobile',
WINDOWS_PHONE: 'Windows Phone',
XBOX: 'Xbox',
ZENWALK: 'Zenwalk'
// TODO : test!
});
module.exports = {
Browser,
BrowserType,
CPU,
Device,
Vendor,
Engine,
OS
};

View File

@@ -0,0 +1,367 @@
// Generated ESM version of ua-parser-js/enums
// DO NOT EDIT THIS FILE!
// Source: /src/enums/ua-parser-enums.js
///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Business License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const Browser = Object.freeze({
_2345_EXPLORER: '2345Explorer',
_360: '360 Browser',
ALIPAY: 'Alipay',
AMAYA: 'Amaya',
ANDROID: 'Android Browser',
ARORA: 'Arora',
AVANT: 'Avant',
AVAST: 'Avast Secure Browser',
AVG: 'AVG Secure Browser',
BAIDU: 'Baidu Browser',
BASILISK: 'Basilisk',
BLAZER: 'Blazer',
BOLT: 'Bolt',
BOWSER: 'Bowser',
BRAVE: 'Brave',
CAMINO: 'Camino',
CHIMERA: 'Chimera',
CHROME: 'Chrome',
CHROME_HEADLESS: 'Chrome Headless',
CHROME_MOBILE: 'Mobile Chrome',
CHROME_WEBVIEW: 'Chrome WebView',
CHROMIUM: 'Chromium',
COBALT: 'Cobalt',
COC_COC: 'Coc Coc',
COMODO_DRAGON: 'Comodo Dragon',
CONKEROR: 'Conkeror',
DILLO: 'Dillo',
DOLPHIN: 'Dolphin',
DORIS: 'Doris',
DUCKDUCKGO: 'DuckDuckGo',
EDGE: 'Edge',
EPIPHANY: 'Epiphany',
FACEBOOK: 'Facebook',
FALKON: 'Falkon',
FIREBIRD: 'Firebird',
FIREFOX: 'Firefox',
FIREFOX_FOCUS: 'Firefox Focus',
FIREFOX_MOBILE: 'Mobile Firefox',
FIREFOX_REALITY: 'Firefox Reality',
FENNEC: 'Fennec',
FLOCK: 'Flock',
FLOW: 'Flow',
GO: 'GoBrowser',
GOOGLE_SEARCH: 'GSA',
HEYTAP: 'HeyTap',
HUAWEI: 'Huawei Browser',
ICAB: 'iCab',
ICE: 'ICE Browser',
ICEAPE: 'IceApe',
ICECAT: 'IceCat',
ICEDRAGON: 'IceDragon',
ICEWEASEL: 'IceWeasel',
IE: 'IE',
INSTAGRAM: 'Instagram',
IRIDIUM: 'Iridium',
IRON: 'Iron',
JASMINE: 'Jasmine',
KONQUEROR: 'Konqueror',
KAKAO: 'KakaoTalk',
KHTML: 'KHTML',
K_MELEON: 'K-Meleon',
KLAR: 'Klar',
KLARNA: 'Klarna',
KINDLE: 'Kindle',
LENOVO: 'Smart Lenovo Browser',
LIEBAO: 'LBBROWSER',
LINE: 'Line',
LINKEDIN: 'LinkedIn',
LINKS: 'Links',
LUNASCAPE: 'Lunascape',
LYNX: 'Lynx',
MAEMO: 'Maemo Browser',
MAXTHON: 'Maxthon',
MIDORI: 'Midori',
MINIMO: 'Minimo',
MIUI: 'MIUI Browser',
MOZILLA: 'Mozilla',
MOSAIC: 'Mosaic',
NAVER: 'Naver',
NETFRONT: 'NetFront',
NETSCAPE: 'Netscape',
NETSURF: 'Netsurf',
NOKIA: 'Nokia Browser',
OBIGO: 'Obigo',
OCULUS: 'Oculus Browser',
OMNIWEB: 'OmniWeb',
OPERA: 'Opera',
OPERA_COAST: 'Opera Coast',
OPERA_MINI: 'Opera Mini',
OPERA_MOBI: 'Opera Mobi',
OPERA_TABLET: 'Opera Tablet',
OPERA_TOUCH: 'Opera Touch',
OVI: 'OviBrowser',
PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
PICOBROWSER: 'Pico Browser',
POLARIS: 'Polaris',
PUFFIN: 'Puffin',
QQ: 'QQBrowser',
QQ_LITE: 'QQBrowserLite',
QUARK: 'Quark',
QUPZILLA: 'QupZilla',
REKONQ: 'rekonq',
ROCKMELT: 'Rockmelt',
SAFARI: 'Safari',
SAFARI_MOBILE: 'Mobile Safari',
SAILFISH: 'Sailfish Browser',
SAMSUNG: 'Samsung Internet',
SEAMONKEY: 'SeaMonkey',
SILK: 'Silk',
SKYFIRE: 'Skyfire',
SLEIPNIR: 'Sleipnir',
SLIMBROWSER: 'SlimBrowser',
SNAPCHAT: 'Snapchat',
SOGOU_EXPLORER: 'Sogou Explorer',
SOGOU_MOBILE: 'Sogou Mobile',
SWIFTFOX: 'Swiftfox',
TESLA: 'Tesla',
TIKTOK: 'TikTok',
TIZEN: 'Tizen Browser',
TWITTER: 'Twitter',
UC: 'UCBrowser',
UP: 'UP.Browser',
VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
WATERFOX: 'Waterfox',
WEBKIT: 'WebKit',
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
WOLVIC: 'Wolvic',
YANDEX: 'Yandex'
// TODO : test!
});
const BrowserType = Object.freeze({
CRAWLER: 'crawler',
CLI: 'cli',
EMAIL: 'email',
FETCHER: 'fetcher',
INAPP: 'inapp',
MODULE: 'module'
});
const CPU = Object.freeze({
ARM : 'arm',
ARM_64: 'arm64',
ARM_HF: 'armhf',
AVR: 'avr',
AVR_32: 'avr32',
IA64: 'ia64',
IRIX: 'irix',
IRIX_64: 'irix64',
MIPS: 'mips',
MIPS_64: 'mips64',
M68K: '68k',
PA_RISC: 'pa-risc',
PPC: 'ppc',
SPARC: 'sparc',
SPARC_64: 'sparc64',
X86: 'ia32',
X86_64: 'amd64'
});
const Device = Object.freeze({
CONSOLE: 'console',
DESKTOP: 'desktop',
EMBEDDED: 'embedded',
MOBILE: 'mobile',
SMARTTV: 'smarttv',
TABLET: 'tablet',
WEARABLE: 'wearable',
XR: 'xr'
});
const Vendor = Object.freeze({
ACER: 'Acer',
ALCATEL: 'Alcatel',
APPLE: 'Apple',
AMAZON: 'Amazon',
ARCHOS: 'Archos',
ASUS: 'ASUS',
ATT: 'AT&T',
BENQ: 'BenQ',
BLACKBERRY: 'BlackBerry',
DELL: 'Dell',
ESSENTIAL: 'Essential',
FACEBOOK: 'Facebook',
FAIRPHONE: 'Fairphone',
GEEKSPHONE: 'GeeksPhone',
GENERIC: 'Generic',
GOOGLE: 'Google',
HP: 'HP',
HTC: 'HTC',
HUAWEI: 'Huawei',
INFINIX: 'Infinix',
JOLLA: 'Jolla',
KOBO: 'Kobo',
LENOVO: 'Lenovo',
LG: 'LG',
MEIZU: 'Meizu',
MICROSOFT: 'Microsoft',
MOTOROLA: 'Motorola',
NEXIAN: 'Nexian',
NINTENDO: 'Nintendo',
NOKIA: 'Nokia',
NVIDIA: 'Nvidia',
ONEPLUS: 'OnePlus',
OPPO: 'OPPO',
OUYA: 'Ouya',
PALM: 'Palm',
PANASONIC: 'Panasonic',
PEBBLE: 'Pebble',
POLYTRON: 'Polytron',
REALME: 'Realme',
RIM: 'RIM',
ROKU: 'Roku',
SAMSUNG: 'Samsung',
SHARP: 'Sharp',
SIEMENS: 'Siemens',
SONY: 'Sony',
SPRINT: 'Sprint',
TECHNISAT: 'TechniSAT',
TECNO: 'Tecno',
TESLA: 'Tesla',
ULEFONE: 'Ulefone',
VIVO: 'Vivo',
VODAFONE: 'Vodafone',
XBOX: 'Xbox',
XIAOMI: 'Xiaomi',
ZEBRA: 'Zebra',
ZTE: 'ZTE',
// TODO : test!
});
const Engine = Object.freeze({
AMAYA: 'Amaya',
BLINK: 'Blink',
EDGEHTML: 'EdgeHTML',
FLOW: 'Flow',
GECKO: 'Gecko',
GOANNA: 'Goanna',
ICAB: 'iCab',
KHTML: 'KHTML',
LIBWEB: 'LibWeb',
LINKS: 'Links',
LYNX: 'Lynx',
NETFRONT: 'NetFront',
NETSURF: 'NetSurf',
PRESTO: 'Presto',
TASMAN: 'Tasman',
TRIDENT: 'Trident',
W3M: 'w3m',
WEBKIT: 'WebKit'
});
const OS = Object.freeze({
AIX: 'AIX',
AMIGA_OS: 'Amiga OS',
ANDROID: 'Android',
ANDROID_X86: 'Android-x86',
ARCH: 'Arch',
BADA: 'Bada',
BEOS: 'BeOS',
BLACKBERRY: 'BlackBerry',
CENTOS: 'CentOS',
CHROME_OS: 'Chrome OS',
CHROMECAST: 'Chromecast',
CONTIKI: 'Contiki',
DEBIAN: 'Debian',
DEEPIN: 'Deepin',
DRAGONFLY: 'DragonFly',
ELEMENTARY_OS: 'elementary OS',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
FUCHSIA: 'Fuchsia',
GENTOO: 'Gentoo',
GHOSTBSD: 'GhostBSD',
GNU: 'GNU',
HAIKU: 'Haiku',
HARMONYOS: 'HarmonyOS',
HP_UX: 'HP-UX',
HURD: 'Hurd',
IOS: 'iOS',
JOLI: 'Joli',
KAIOS: 'KaiOS',
LINPUS: 'Linpus',
LINSPIRE: 'Linspire',
LINUX: 'Linux',
MACOS: 'macOS',
MAEMO: 'Maemo',
MAGEIA: 'Mageia',
MANDRIVA: 'Mandriva',
MANJARO: 'Manjaro',
MEEGO: 'MeeGo',
MINIX: 'Minix',
MINT: 'Mint',
MORPH_OS: 'Morph OS',
NETBSD: 'NetBSD',
NETRANGE: 'NetRange',
NETTV: 'NetTV',
NINTENDO: 'Nintendo',
OPENBSD: 'OpenBSD',
OPENVMS: 'OpenVMS',
OS2: 'OS/2',
PALM: 'Palm',
PC_BSD: 'PC-BSD',
PCLINUXOS: 'PCLinuxOS',
PLAN9: 'Plan9',
PLAYSTATION: 'PlayStation',
QNX: 'QNX',
RASPBIAN: 'Raspbian',
REDHAT: 'RedHat',
RIM_TABLET_OS: 'RIM Tablet OS',
RISC_OS: 'RISC OS',
SABAYON: 'Sabayon',
SAILFISH: 'Sailfish',
SERENITYOS: 'SerenityOS',
SERIES40: 'Series40',
SLACKWARE: 'Slackware',
SOLARIS: 'Solaris',
SUSE: 'SUSE',
SYMBIAN: 'Symbian',
TIZEN: 'Tizen',
UBUNTU: 'Ubuntu',
UNIX: 'Unix',
VECTORLINUX: 'VectorLinux',
VIERA: 'Viera',
WATCHOS: 'watchOS',
WEBOS: 'WebOS',
WINDOWS: 'Windows',
WINDOWS_MOBILE: 'Windows Mobile',
WINDOWS_PHONE: 'Windows Phone',
XBOX: 'Xbox',
ZENWALK: 'Zenwalk'
// TODO : test!
});
export {
Browser,
BrowserType,
CPU,
Device,
Vendor,
Engine,
OS
};

View File

@@ -0,0 +1,14 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>
import type { UAParserExt } from "../main/ua-parser";
export const CLIs: UAParserExt;
export const Crawlers: UAParserExt;
export const ExtraDevices: UAParserExt;
export const Emails: UAParserExt;
export const Fetchers: UAParserExt;
export const InApps: UAParserExt;
export const MediaPlayers: UAParserExt;
export const Modules: UAParserExt;

View File

@@ -0,0 +1,344 @@
///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Business License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const MODEL = 'model';
const NAME = 'name';
const TYPE = 'type';
const VENDOR = 'vendor';
const VERSION = 'version';
const MOBILE = 'mobile';
const TABLET = 'tablet';
const CRAWLER = 'crawler';
const CLI = 'cli';
const EMAIL = 'email';
const FETCHER = 'fetcher';
const INAPP = 'inapp';
const MODULE = 'module';
//////////////////////
// COMMAND LINE APPS
/////////////////////
const CLIs = Object.freeze({
browser : [
// wget / curl / lynx
[/(wget|curl|lynx)[\/ ]([\w\.]+)/i], [NAME, VERSION, [TYPE, CLI]]
]
});
////////////////////////
// CRAWLERS / SPIDERS
///////////////////////
const Crawlers = Object.freeze({
browser : [
// Amazonbot - https://developer.amazon.com/amazonbot
// Applebot - http://apple.com/go/applebot
// Bingbot - http://www.bing.com/bingbot.htm
// DuckDuckBot - http://duckduckgo.com/duckduckbot.html
// FacebookBot - https://developers.facebook.com/docs/sharing/bot/
// GPTBot - https://platform.openai.com/docs/gptbot
[/((?:amazon|apple|bing|duckduck|facebook|gpt)bot)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
[/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Bytespider
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
[/((?:bytespider|(?=yahoo! )slurp))/i],
[NAME, [TYPE, CRAWLER]],
// ClaudeBot
[/(claude(?:bot|-web))\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Googlebot - http://www.google.com/bot.html
[
/(google(?:bot|other)(?:-image|-video|-news|-extended)?|(?:storebot-)?google(?:-inspectiontool)?)\/?([\w\.]*)/i
],
[NAME, VERSION, [TYPE, CRAWLER]],
// Sogou Spider
[/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Yandex Bots - https://yandex.com/bots
[
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i
],
[NAME, VERSION, [TYPE, CRAWLER]]
]
});
//////////////////
// EXTRA DEVICES
/////////////////
const ExtraDevices = Object.freeze({
device : [[
/(nook)[\w ]+build\/(\w+)/i, // Nook
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(u304aa)/i // AT&T
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
/\bsie-(\w*)/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/\b(rct\w+) b/i // RCA Tablets
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [
/\b(tm\d{3}\w+) b/i
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
/\b(k88) b/i // ZTE K Series Tablet
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
/\b(nx\d{3}j) b/i // ZTE Nubia
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
/\b(zur\d{3}) b/i // Swiss ZUR Tablet
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
/\b((zeki)?tb.*\b) b/i // Zeki Tablets
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
/\b([yr]\d{2}) b/i,
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [
/\b(ns-?\w{0,9}) b/i // Insignia Tablets
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [
/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
/\b(ph-1) /i // Essential PH-1
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [
/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
/\btu_(1491) b/i // Rotor Tablets
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]]
]
});
///////////////
// EMAIL APPS
//////////////
const Emails = Object.freeze({
browser : [
// Microsoft Outlook / Thunderbird
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
]
});
///////////////////////
// ON-DEMAND SCRAPERS
//////////////////////
const Fetchers = Object.freeze({
browser : [
// BingPreview / Mastodon / Pinterestbot / Redditbot / Telegrambot / Twitterbot
[/(bingpreview|mastodon|(?:discord|linkedin|pinterest|reddit|telegram|twitter)bot)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, FETCHER]],
// Google Bots / Snapchat
[/(feedfetcher-google|google-read-aloud|(?=bot; )snapchat)/i],
[NAME, [TYPE, FETCHER]],
// Slackbot - https://api.slack.com/robots
[/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i],
[NAME, VERSION, [TYPE, FETCHER]],
// WhatsApp
[/(whatsapp)\/([\w\.]+)[\/ ][ianw]/i],
[NAME, VERSION, [TYPE, FETCHER]],
// Yandex Bots - https://yandex.com/bots
[
/(yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i,
/(yandex(?:sitelinks|userproxy))/i
],
[NAME, VERSION, [TYPE, FETCHER]]
]
});
////////////////////
// IN-APP BROWSERS
///////////////////
const InApps = Object.freeze({
browser : [
[/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]]
]
});
//////////////////////
// MEDIA PLAYER APPS
/////////////////////
const MediaPlayers = Object.freeze({
browser : [[
/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
/(coremedia) v([\w\._]+)/i
], [NAME, VERSION], [
/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
], [NAME, VERSION], [
/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
], [NAME, VERSION], [
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
// NSPlayer/PSP-InternetRadioPlayer/Videos
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
/(lg player|nexplayer)\s([\d\.]+)/i,
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
], [NAME, VERSION], [
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
], [NAME, VERSION], [
/(flrp)\/([\w\.-]+)/i // Flip Player
], [[NAME, 'Flip Player'], VERSION], [
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
], [NAME], [
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
// Gstreamer
], [NAME, VERSION], [
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
// Java/urllib/requests/wget/cURL
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
], [NAME, VERSION], [
/(htc_one_s)\/([\d\.]+)/i, // HTC One S
], [[NAME, /_/g, ' '], VERSION], [
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
// MPlayer SVN
], [NAME, VERSION], [
/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
], [NAME, VERSION], [
/(mplayer)/i, // MPlayer (no other info)
/(yourmuze)/i, // YourMuze
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
], [NAME], [
/(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout
], [NAME, VERSION], [
/(nokia\d+)\/([\w\.-]+)/i // Nokia
], [NAME, VERSION], [
/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
], [NAME, VERSION], [
/(winamp)3 version ([\w\.-]+)/i, // Winamp
/(winamp)\s([\w\.-]+)/i,
/(winamp)mpeg\/([\w\.-]+)/i
], [NAME, VERSION], [
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
// inlight radio
], [NAME], [
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
// SoundTap/Totem/Stagefright/Streamium
], [NAME, VERSION], [
/(smp)([\d\.]+)/i // SMP
], [NAME, VERSION], [
/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
/(vlc)\/([\w\.-]+)/i,
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
/(itunes)\/([\d\.]+)/i // iTunes
], [NAME, VERSION], [
/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
/(windows-media-player)\/([\w\.-]+)/i
], [[NAME, /-/g, ' '], VERSION], [
/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
// Windows Media Server
], [VERSION, [NAME, 'Windows']], [
/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
], [NAME, VERSION], [
/(rad.io)\s([\d\.]+)/i, // Rad.io
/(radio.(?:de|at|fr))\s([\d\.]+)/i
], [[NAME, 'rad.io'], VERSION]
]
});
////////////////////////
// MODULES / LIBRARIES
///////////////////////
const Modules = Object.freeze({
browser : [
// Axios/jsdom/Scrapy
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]]
]
});
module.exports = {
CLIs,
Crawlers,
ExtraDevices,
Emails,
Fetchers,
InApps,
MediaPlayers,
Modules
};

View File

@@ -0,0 +1,348 @@
// Generated ESM version of ua-parser-js/extensions
// DO NOT EDIT THIS FILE!
// Source: /src/extensions/ua-parser-extensions.js
///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Business License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const MODEL = 'model';
const NAME = 'name';
const TYPE = 'type';
const VENDOR = 'vendor';
const VERSION = 'version';
const MOBILE = 'mobile';
const TABLET = 'tablet';
const CRAWLER = 'crawler';
const CLI = 'cli';
const EMAIL = 'email';
const FETCHER = 'fetcher';
const INAPP = 'inapp';
const MODULE = 'module';
//////////////////////
// COMMAND LINE APPS
/////////////////////
const CLIs = Object.freeze({
browser : [
// wget / curl / lynx
[/(wget|curl|lynx)[\/ ]([\w\.]+)/i], [NAME, VERSION, [TYPE, CLI]]
]
});
////////////////////////
// CRAWLERS / SPIDERS
///////////////////////
const Crawlers = Object.freeze({
browser : [
// Amazonbot - https://developer.amazon.com/amazonbot
// Applebot - http://apple.com/go/applebot
// Bingbot - http://www.bing.com/bingbot.htm
// DuckDuckBot - http://duckduckgo.com/duckduckbot.html
// FacebookBot - https://developers.facebook.com/docs/sharing/bot/
// GPTBot - https://platform.openai.com/docs/gptbot
[/((?:amazon|apple|bing|duckduck|facebook|gpt)bot)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
[/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Bytespider
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
[/((?:bytespider|(?=yahoo! )slurp))/i],
[NAME, [TYPE, CRAWLER]],
// ClaudeBot
[/(claude(?:bot|-web))\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Googlebot - http://www.google.com/bot.html
[
/(google(?:bot|other)(?:-image|-video|-news|-extended)?|(?:storebot-)?google(?:-inspectiontool)?)\/?([\w\.]*)/i
],
[NAME, VERSION, [TYPE, CRAWLER]],
// Sogou Spider
[/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, CRAWLER]],
// Yandex Bots - https://yandex.com/bots
[
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i
],
[NAME, VERSION, [TYPE, CRAWLER]]
]
});
//////////////////
// EXTRA DEVICES
/////////////////
const ExtraDevices = Object.freeze({
device : [[
/(nook)[\w ]+build\/(\w+)/i, // Nook
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(u304aa)/i // AT&T
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
/\bsie-(\w*)/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/\b(rct\w+) b/i // RCA Tablets
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [
/\b(tm\d{3}\w+) b/i
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
/\b(k88) b/i // ZTE K Series Tablet
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
/\b(nx\d{3}j) b/i // ZTE Nubia
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
/\b(zur\d{3}) b/i // Swiss ZUR Tablet
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
/\b((zeki)?tb.*\b) b/i // Zeki Tablets
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
/\b([yr]\d{2}) b/i,
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [
/\b(ns-?\w{0,9}) b/i // Insignia Tablets
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [
/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
/\b(ph-1) /i // Essential PH-1
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [
/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
/\btu_(1491) b/i // Rotor Tablets
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]]
]
});
///////////////
// EMAIL APPS
//////////////
const Emails = Object.freeze({
browser : [
// Microsoft Outlook / Thunderbird
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
]
});
///////////////////////
// ON-DEMAND SCRAPERS
//////////////////////
const Fetchers = Object.freeze({
browser : [
// BingPreview / Mastodon / Pinterestbot / Redditbot / Telegrambot / Twitterbot
[/(bingpreview|mastodon|(?:discord|linkedin|pinterest|reddit|telegram|twitter)bot)\/([\w\.]+)/i],
[NAME, VERSION, [TYPE, FETCHER]],
// Google Bots / Snapchat
[/(feedfetcher-google|google-read-aloud|(?=bot; )snapchat)/i],
[NAME, [TYPE, FETCHER]],
// Slackbot - https://api.slack.com/robots
[/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i],
[NAME, VERSION, [TYPE, FETCHER]],
// WhatsApp
[/(whatsapp)\/([\w\.]+)[\/ ][ianw]/i],
[NAME, VERSION, [TYPE, FETCHER]],
// Yandex Bots - https://yandex.com/bots
[
/(yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i,
/(yandex(?:sitelinks|userproxy))/i
],
[NAME, VERSION, [TYPE, FETCHER]]
]
});
////////////////////
// IN-APP BROWSERS
///////////////////
const InApps = Object.freeze({
browser : [
[/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]]
]
});
//////////////////////
// MEDIA PLAYER APPS
/////////////////////
const MediaPlayers = Object.freeze({
browser : [[
/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
/(coremedia) v([\w\._]+)/i
], [NAME, VERSION], [
/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
], [NAME, VERSION], [
/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
], [NAME, VERSION], [
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
// NSPlayer/PSP-InternetRadioPlayer/Videos
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
/(lg player|nexplayer)\s([\d\.]+)/i,
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
], [NAME, VERSION], [
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
], [NAME, VERSION], [
/(flrp)\/([\w\.-]+)/i // Flip Player
], [[NAME, 'Flip Player'], VERSION], [
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
], [NAME], [
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
// Gstreamer
], [NAME, VERSION], [
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
// Java/urllib/requests/wget/cURL
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
], [NAME, VERSION], [
/(htc_one_s)\/([\d\.]+)/i, // HTC One S
], [[NAME, /_/g, ' '], VERSION], [
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
// MPlayer SVN
], [NAME, VERSION], [
/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
], [NAME, VERSION], [
/(mplayer)/i, // MPlayer (no other info)
/(yourmuze)/i, // YourMuze
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
], [NAME], [
/(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout
], [NAME, VERSION], [
/(nokia\d+)\/([\w\.-]+)/i // Nokia
], [NAME, VERSION], [
/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
], [NAME, VERSION], [
/(winamp)3 version ([\w\.-]+)/i, // Winamp
/(winamp)\s([\w\.-]+)/i,
/(winamp)mpeg\/([\w\.-]+)/i
], [NAME, VERSION], [
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
// inlight radio
], [NAME], [
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
// SoundTap/Totem/Stagefright/Streamium
], [NAME, VERSION], [
/(smp)([\d\.]+)/i // SMP
], [NAME, VERSION], [
/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
/(vlc)\/([\w\.-]+)/i,
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
/(itunes)\/([\d\.]+)/i // iTunes
], [NAME, VERSION], [
/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
/(windows-media-player)\/([\w\.-]+)/i
], [[NAME, /-/g, ' '], VERSION], [
/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
// Windows Media Server
], [VERSION, [NAME, 'Windows']], [
/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
], [NAME, VERSION], [
/(rad.io)\s([\d\.]+)/i, // Rad.io
/(radio.(?:de|at|fr))\s([\d\.]+)/i
], [[NAME, 'rad.io'], VERSION]
]
});
////////////////////////
// MODULES / LIBRARIES
///////////////////////
const Modules = Object.freeze({
browser : [
// Axios/jsdom/Scrapy
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]]
]
});
export {
CLIs,
Crawlers,
ExtraDevices,
Emails,
Fetchers,
InApps,
MediaPlayers,
Modules
};

15
src/helpers/ua-parser-helpers.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>
import { IResult } from "../main/ua-parser";
declare function isAppleSilicon(res: IResult): boolean;
declare function isChromiumBased(res: IResult): boolean;
declare function isFrozenUA(ua: string): boolean;
export {
isAppleSilicon,
isChromiumBased,
isFrozenUA
}

View File

@@ -0,0 +1,22 @@
///////////////////////////////////////////////
/* Helpers for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
AGPLv3 License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
const { CPU, OS, Engine } = require('../enums/ua-parser-enums');
const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM);
const isChromiumBased = (res) => res.engine.is(Engine.BLINK);
const isFrozenUA = (ua) => /^Mozilla\/5\.0 \((Windows NT 10\.0; Win64; x64|Macintosh; Intel Mac OS X 10_15_7|X11; Linux x86_64|X11; CrOS x86_64 14541\.0\.0|Fuchsia|Linux; Android 10; K)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/\d+\.0\.0\.0 (Mobile )?Safari\/537\.36/.test(ua);
module.exports = {
isAppleSilicon,
isChromiumBased,
isFrozenUA
}

View File

@@ -0,0 +1,26 @@
// Generated ESM version of ua-parser-js/helpers
// DO NOT EDIT THIS FILE!
// Source: /src/helpers/ua-parser-helpers.js
///////////////////////////////////////////////
/* Helpers for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com>
AGPLv3 License */
//////////////////////////////////////////////
/*jshint esversion: 6 */
import { CPU, OS, Engine } from '../enums/ua-parser-enums';
const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM);
const isChromiumBased = (res) => res.engine.is(Engine.BLINK);
const isFrozenUA = (ua) => /^Mozilla\/5\.0 \((Windows NT 10\.0; Win64; x64|Macintosh; Intel Mac OS X 10_15_7|X11; Linux x86_64|X11; CrOS x86_64 14541\.0\.0|Fuchsia|Linux; Android 10; K)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/\d+\.0\.0\.0 (Mobile )?Safari\/537\.36/.test(ua);
export {
isAppleSilicon,
isChromiumBased,
isFrozenUA
}

109
src/main/ua-parser.d.ts vendored Normal file
View File

@@ -0,0 +1,109 @@
// Type definitions for UAParser.js v2.0.0-beta.3
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>
declare namespace UAParser {
interface IData<T> {
is(val: string): boolean;
toString(): string;
withClientHints(): PromiseLike<T> | T;
withFeatureCheck(): T;
}
interface IBrowser extends IData<IBrowser> {
name?: string;
version?: string;
major?: string;
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module';
}
interface ICPU extends IData<ICPU> {
architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'ppc' | 'sparc' | 'sparc64';
}
interface IDevice extends IData<IDevice> {
type?: 'mobile' | 'tablet' | 'console' | 'smarttv' | 'wearable' | 'xr' | 'embedded';
vendor?: string;
model?: string;
}
interface IEngine extends IData<IEngine> {
name?: 'Amaya' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit';
version?: string;
}
interface IOS extends IData<IOS> {
name?: string;
version?: string;
}
interface IResult extends IData<IResult> {
ua: string;
browser: IBrowser;
cpu: ICPU;
device: IDevice;
engine: IEngine;
os: IOS;
}
type RegexMap = ((RegExp | string | (string | RegExp | Function)[])[])[];
type UAParserProps = 'browser' | 'cpu' | 'device' | 'engine' | 'os';
type UAParserExt = Partial<Record<UAParserProps, RegexMap>> | Partial<Record<UAParserProps, RegexMap>>[];
export function UAParser(uastring?: string, extensions?: UAParserExt, headers?: Record<string, string>): IResult;
export function UAParser(uastring?: string, headers?: Record<string, string>): IResult;
export function UAParser(extensions?: UAParserExt, headers?: Record<string, string>): IResult;
export function UAParser(headers?: Record<string, string>): IResult;
export class UAParser {
static readonly BROWSER: {
NAME: 'name';
VERSION: 'version';
MAJOR: 'major';
TYPE: 'type';
};
static readonly CPU: {
ARCHITECTURE: 'architecture';
};
static readonly DEVICE: {
TYPE: 'type';
VENDOR: 'vendor';
MODEL: 'model';
CONSOLE: 'console';
MOBILE: 'mobile';
SMARTTV: 'smarttv';
TABLET: 'tablet';
WEARABLE: 'wearable';
XR: 'xr';
EMBEDDED: 'embedded';
};
static readonly ENGINE: {
NAME: 'name';
VERSION: 'version';
};
static readonly OS: {
NAME: 'name';
VERSION: 'version';
};
static readonly VERSION: string;
constructor(uastring?: string, extensions?: UAParserExt, headers?: Record<string, string>);
constructor(uastring?: string, headers?: Record<string, string>);
constructor(extensions?: UAParserExt, headers?: Record<string, string>);
constructor(headers?: Record<string, string>);
getUA(): string;
getBrowser(): IBrowser;
getCPU(): ICPU;
getDevice(): IDevice;
getEngine(): IEngine;
getOS(): IOS;
getResult(): IResult;
setUA(uastring: string): UAParser;
}
}
export as namespace UAParser;
export = UAParser;

1295
src/main/ua-parser.js Executable file

File diff suppressed because it is too large Load Diff

1253
src/main/ua-parser.mjs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,881 +0,0 @@
/**
* UAParser.js v0.7.10
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2015 Faisal Salman <fyzlman@gmail.com>
* Dual licensed under GPLv2 & MIT
*/
(function (window, undefined) {
'use strict';
//////////////
// Constants
/////////////
var LIBVERSION = '0.7.10',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
UNDEF_TYPE = 'undefined',
OBJ_TYPE = 'object',
STR_TYPE = 'string',
MAJOR = 'major', // deprecated
MODEL = 'model',
NAME = 'name',
TYPE = 'type',
VENDOR = 'vendor',
VERSION = 'version',
ARCHITECTURE= 'architecture',
CONSOLE = 'console',
MOBILE = 'mobile',
TABLET = 'tablet',
SMARTTV = 'smarttv',
WEARABLE = 'wearable',
EMBEDDED = 'embedded';
///////////
// Helper
//////////
var util = {
extend : function (regexes, extensions) {
for (var i in extensions) {
if ("browser cpu device engine os".indexOf(i) !== -1 && extensions[i].length % 2 === 0) {
regexes[i] = extensions[i].concat(regexes[i]);
}
}
return regexes;
},
has : function (str1, str2) {
if (typeof str1 === "string") {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
} else {
return false;
}
},
lowerize : function (str) {
return str.toLowerCase();
},
major : function (version) {
return typeof(version) === STR_TYPE ? version.split(".")[0] : undefined;
}
};
///////////////
// Map helper
//////////////
var mapper = {
rgx : function () {
var result, i = 0, j, k, p, q, matches, match, args = arguments;
// loop through all regexes maps
while (i < args.length && !matches) {
var regex = args[i], // even sequence (0,2,4,..)
props = args[i + 1]; // odd sequence (1,3,5,..)
// construct object barebones
if (typeof result === UNDEF_TYPE) {
result = {};
for (p in props) {
if (props.hasOwnProperty(p)){
q = props[p];
if (typeof q === OBJ_TYPE) {
result[q[0]] = undefined;
} else {
result[q] = undefined;
}
}
}
}
// try matching uastring with regexes
j = k = 0;
while (j < regex.length && !matches) {
matches = regex[j++].exec(this.getUA());
if (!!matches) {
for (p = 0; p < props.length; p++) {
match = matches[++k];
q = props[p];
// check if given property is actually array
if (typeof q === OBJ_TYPE && q.length > 0) {
if (q.length == 2) {
if (typeof q[1] == FUNC_TYPE) {
// assign modified match
result[q[0]] = q[1].call(this, match);
} else {
// assign given value, ignore regex match
result[q[0]] = q[1];
}
} else if (q.length == 3) {
// check whether function or regex
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
// call function (usually string mapper)
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
} else {
// sanitize match using given regex
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
}
} else if (q.length == 4) {
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
}
} else {
result[q] = match ? match : undefined;
}
}
}
}
i += 2;
}
return result;
},
str : function (str, map) {
for (var i in map) {
// check if array
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) {
if (util.has(map[i][j], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
} else if (util.has(map[i], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
return str;
}
};
///////////////
// String map
//////////////
var maps = {
browser : {
oldsafari : {
version : {
'1.0' : '/8',
'1.2' : '/1',
'1.3' : '/3',
'2.0' : '/412',
'2.0.2' : '/416',
'2.0.3' : '/417',
'2.0.4' : '/419',
'?' : '/'
}
}
},
device : {
amazon : {
model : {
'Fire Phone' : ['SD', 'KF']
}
},
sprint : {
model : {
'Evo Shift 4G' : '7373KT'
},
vendor : {
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
version : {
'ME' : '4.90',
'NT 3.11' : 'NT3.51',
'NT 4.0' : 'NT4.0',
'2000' : 'NT 5.0',
'XP' : ['NT 5.1', 'NT 5.2'],
'Vista' : 'NT 6.0',
'7' : 'NT 6.1',
'8' : 'NT 6.2',
'8.1' : 'NT 6.3',
'10' : ['NT 6.4', 'NT 10.0'],
'RT' : 'ARM'
}
}
}
};
//////////////
// Regex map
/////////////
var regexes = {
browser : [[
// Presto based
/(opera\smini)\/([\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/([\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80
], [NAME, VERSION], [
/\s(opr)\/([\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION], [
// Mixed
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)\/([\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS
], [NAME, VERSION], [
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
], [[NAME, 'IE'], VERSION], [
/(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge
], [NAME, VERSION], [
/(yabrowser)\/([\w\.]+)/i // Yandex
], [[NAME, 'Yandex'], VERSION], [
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,
// Chrome/OmniWeb/Arora/Tizen/Nokia
/(qqbrowser)[\/\s]?([\w\.]+)/i
// QQBrowser
], [NAME, VERSION], [
/(uc\s?browser)[\/\s]?([\w\.]+)/i,
/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,
/JUC.+(ucweb)[\/\s]?([\w\.]+)/i
// UCBrowser
], [[NAME, 'UCBrowser'], VERSION], [
/(dolfin)\/([\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION], [
/((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION], [
/XiaoMi\/MiuiBrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI Browser']], [
/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i // Android Browser
], [VERSION, [NAME, 'Android Browser']], [
/FBAV\/([\w\.]+);/i // Facebook App for iOS
], [VERSION, [NAME, 'Facebook']], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, 'Firefox']], [
/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, [NAME, 'Mobile Safari']], [
/version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [VERSION, NAME], [
/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [
/(konqueror)\/([\w\.]+)/i, // Konqueror
/(webkit|khtml)\/([\w\.]+)/i
], [NAME, VERSION], [
// Gecko based
/(navigator|netscape)\/([\w\.-]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
/(links)\s\(([\w\.]+)/i, // Links
/(gobrowser)\/?([\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]([\w\.]+)/i // Mosaic
], [NAME, VERSION]
/* /////////////////////
// Media players BEGIN
////////////////////////
, [
/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, // Generic Apple CoreMedia
/(coremedia) v((\d+)[\w\._]+)/i
], [NAME, VERSION], [
/(aqualung|lyssna|bsplayer)\/((\d+)?[\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
], [NAME, VERSION], [
/(ares|ossproxy)\s((\d+)[\w\.-]+)/i // Ares/OSSProxy
], [NAME, VERSION], [
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
// NSPlayer/PSP-InternetRadioPlayer/Videos
/(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, // Clementine/MPD
/(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
/player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i // NexPlayer/LG Player
], [NAME, VERSION], [
/(nexplayer)\s((\d+)[\w\.-]+)/i // Nexplayer
], [NAME, VERSION], [
/(flrp)\/((\d+)[\w\.-]+)/i // Flip Player
], [[NAME, 'Flip Player'], VERSION], [
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
], [NAME], [
/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i
// Gstreamer
], [NAME, VERSION], [
/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, // HTC Streaming Player
/(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
// Java/urllib/requests/wget/cURL
/(lavf)((\d+)[\d\.]+)/i // Lavf (FFMPEG)
], [NAME, VERSION], [
/(htc_one_s)\/((\d+)[\d\.]+)/i // HTC One S
], [[NAME, /_/g, ' '], VERSION], [
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i
// MPlayer SVN
], [NAME, VERSION], [
/(mplayer)(?:\s|\/|[unkow-]+)((\d+)[\w\.-]+)/i // MPlayer
], [NAME, VERSION], [
/(mplayer)/i, // MPlayer (no other info)
/(yourmuze)/i, // YourMuze
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
], [NAME], [
/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i // Nero Home/Nero Scout
], [NAME, VERSION], [
/(nokia\d+)\/((\d+)[\w\.-]+)/i // Nokia
], [NAME, VERSION], [
/\s(songbird)\/((\d+)[\w\.-]+)/i // Songbird/Philips-Songbird
], [NAME, VERSION], [
/(winamp)3 version ((\d+)[\w\.-]+)/i, // Winamp
/(winamp)\s((\d+)[\w\.-]+)/i,
/(winamp)mpeg\/((\d+)[\w\.-]+)/i
], [NAME, VERSION], [
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
// inlight radio
], [NAME], [
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
// SoundTap/Totem/Stagefright/Streamium
], [NAME, VERSION], [
/(smp)((\d+)[\d\.]+)/i // SMP
], [NAME, VERSION], [
/(vlc) media player - version ((\d+)[\w\.]+)/i, // VLC Videolan
/(vlc)\/((\d+)[\w\.-]+)/i,
/(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
/(foobar2000)\/((\d+)[\d\.]+)/i, // Foobar2000
/(itunes)\/((\d+)[\d\.]+)/i // iTunes
], [NAME, VERSION], [
/(wmplayer)\/((\d+)[\w\.-]+)/i, // Windows Media Player
/(windows-media-player)\/((\d+)[\w\.-]+)/i
], [[NAME, /-/g, ' '], VERSION], [
/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i
// Windows Media Server
], [VERSION, [NAME, 'Windows']], [
/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i // RiseUP Radio Alarm
], [NAME, VERSION], [
/(rad.io)\s((\d+)[\d\.]+)/i, // Rad.io
/(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i
], [[NAME, 'rad.io'], VERSION]
//////////////////////
// Media players END
////////////////////*/
],
cpu : [[
/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64
], [[ARCHITECTURE, 'amd64']], [
/(ia32(?=;))/i // IA32 (quicktime)
], [[ARCHITECTURE, util.lowerize]], [
/((?:i[346]|x)86)[;\)]/i // IA32
], [[ARCHITECTURE, 'ia32']], [
// PocketPC mistakenly identified as PowerPC
/windows\s(ce|mobile);\sppc;/i
], [[ARCHITECTURE, 'arm']], [
/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC
], [[ARCHITECTURE, /ower/, '', util.lowerize]], [
/(sun4\w)[;\)]/i // SPARC
], [[ARCHITECTURE, 'sparc']], [
/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
], [[ARCHITECTURE, util.lowerize]]
],
device : [[
/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook
], [MODEL, VENDOR, [TYPE, TABLET]], [
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [
/(apple\s{0,1}tv)/i // Apple TV
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
/(archos)\s(gamepad2?)/i, // Archos
/(hp).+(touchpad)/i, // HP TouchPad
/(kindle)\/([\w\.]+)/i, // Kindle
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i // Kindle Fire HD
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i // Fire Phone
], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [
/\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone
], [MODEL, VENDOR, [TYPE, MOBILE]], [
/\((ip[honed|\s\w*]+);/i // iPod/iPhone
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Huawei/Meizu/Motorola/Polytron
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i // Asus
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/\(bb10;\s(\w+)/i // BlackBerry 10
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
// Asus Tablets
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
/(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
/(sony)?(?:sgp.+)\sbuild\//i
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [
/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Phone'], [TYPE, MOBILE]], [
/\s(ouya)\s/i, // Ouya
/(nintendo)\s([wids3u]+)/i // Nintendo
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
/android.+;\s(shield)\sbuild/i // Nvidia
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [
/(playstation\s[34portablevi]+)/i // Playstation
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [
/(sprint\s(\w+))/i // Sprint Phones
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
/(zte)-(\w+)*/i, // ZTE
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
/(nexus\s9)/i // HTC Nexus 9
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
/[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [
/(kin\.[onetw]{3})/i // Microsoft Kin
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
// Motorola
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,
/mot[\s-]?(\w+)*/i,
/(XT\d{3,4}) build\//i,
/(nexus\s[6])/i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,
/((SM-T\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
/sec-((sgh\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
/(samsung);smarttv/i
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
/\(dtv[\);].+(aquos)/i // Sharp
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/sie-(\w+)*/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
/(nokia)[\s_-]?([\w-]+)*/i
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
/android\s3\.[\s\w;-]{10}(a\d{3})/i // Acer
], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
/(lg) netcast\.tv/i // LG SmartTV
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
/(nexus\s[45])/i, // LG
/lg[e;\s\/-]+(\w+)*/i
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
/linux;.+((jolla));/i // Jolla
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/((pebble))app\/[\d\.]+\s/i // Pebble
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
/android.+;\s(glass)\s\d/i // Google Glass
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
/android.+(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i // Xiaomi Mi
], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [
/\s(tablet)[;\/\s]/i, // Unidentifiable Tablet
/\s(mobile)[;\/\s]/i // Unidentifiable Mobile
], [[TYPE, util.lowerize], VENDOR, MODEL]
/*//////////////////////////
// TODO: move to string map
////////////////////////////
/(C6603)/i // Sony Xperia Z C6603
], [[MODEL, 'Xperia Z C6603'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [
/(C6903)/i // Sony Xperia Z 1
], [[MODEL, 'Xperia Z 1'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [
/(SM-G900[F|H])/i // Samsung Galaxy S5
], [[MODEL, 'Galaxy S5'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G7102)/i // Samsung Galaxy Grand 2
], [[MODEL, 'Galaxy Grand 2'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G530H)/i // Samsung Galaxy Grand Prime
], [[MODEL, 'Galaxy Grand Prime'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G313HZ)/i // Samsung Galaxy V
], [[MODEL, 'Galaxy V'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-T805)/i // Samsung Galaxy Tab S 10.5
], [[MODEL, 'Galaxy Tab S 10.5'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [
/(SM-G800F)/i // Samsung Galaxy S5 Mini
], [[MODEL, 'Galaxy S5 Mini'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-T311)/i // Samsung Galaxy Tab 3 8.0
], [[MODEL, 'Galaxy Tab 3 8.0'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [
/(R1001)/i // Oppo R1001
], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
/(X9006)/i // Oppo Find 7a
], [[MODEL, 'Find 7a'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(R2001)/i // Oppo YOYO R2001
], [[MODEL, 'Yoyo R2001'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(R815)/i // Oppo Clover R815
], [[MODEL, 'Clover R815'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(U707)/i // Oppo Find Way S
], [[MODEL, 'Find Way S'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(T3C)/i // Advan Vandroid T3C
], [MODEL, [VENDOR, 'Advan'], [TYPE, TABLET]], [
/(ADVAN T1J\+)/i // Advan Vandroid T1J+
], [[MODEL, 'Vandroid T1J+'], [VENDOR, 'Advan'], [TYPE, TABLET]], [
/(ADVAN S4A)/i // Advan Vandroid S4A
], [[MODEL, 'Vandroid S4A'], [VENDOR, 'Advan'], [TYPE, MOBILE]], [
/(V972M)/i // ZTE V972M
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
/(i-mobile)\s(IQ\s[\d\.]+)/i // i-mobile IQ
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/(IQ6.3)/i // i-mobile IQ IQ 6.3
], [[MODEL, 'IQ 6.3'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [
/(i-mobile)\s(i-style\s[\d\.]+)/i // i-mobile i-STYLE
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/(i-STYLE2.1)/i // i-mobile i-STYLE 2.1
], [[MODEL, 'i-STYLE 2.1'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [
/(mobiistar touch LAI 512)/i // mobiistar touch LAI 512
], [[MODEL, 'Touch LAI 512'], [VENDOR, 'mobiistar'], [TYPE, MOBILE]], [
/////////////
// END TODO
///////////*/
],
engine : [[
/windows.+\sedge\/([\w\.]+)/i // EdgeHTML
], [VERSION, [NAME, 'EdgeHTML']], [
/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [
/rv\:([\w\.]+).*(gecko)/i // Gecko
], [VERSION, NAME]
],
os : [[
// Windows based
/microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes)
], [NAME, VERSION], [
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
// Mobile/Embedded OS
/\((bb)(10);/i // BlackBerry 10
], [[NAME, 'BlackBerry'], VERSION], [
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
/linux;.+(sailfish);/i // Sailfish OS
], [NAME, VERSION], [
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
], [[NAME, 'Symbian'], VERSION], [
/\((series40);/i // Series 40
], [NAME], [
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [
// Console
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
/(gnu)\s?([\w\.]+)*/i // GNU
], [NAME, VERSION], [
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[
// Solaris
/(sunos)\s?([\w\.]+\d)*/i // Solaris
], [[NAME, 'Solaris'], VERSION], [
// BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [NAME, VERSION],[
/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i // iOS
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,
/(macintosh|mac(?=_powerpc)\s)/i // Mac OS
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
// Other
/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris
/(haiku)\s(\w+)/i, // Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS
/(unix)\s?([\w\.]+)*/i // UNIX
], [NAME, VERSION]
]
};
/////////////////
// Constructor
////////////////
var UAParser = function (uastring, extensions) {
if (!(this instanceof UAParser)) {
return new UAParser(uastring, extensions).getResult();
}
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
this.getBrowser = function () {
var browser = mapper.rgx.apply(this, rgxmap.browser);
browser.major = util.major(browser.version);
return browser;
};
this.getCPU = function () {
return mapper.rgx.apply(this, rgxmap.cpu);
};
this.getDevice = function () {
return mapper.rgx.apply(this, rgxmap.device);
};
this.getEngine = function () {
return mapper.rgx.apply(this, rgxmap.engine);
};
this.getOS = function () {
return mapper.rgx.apply(this, rgxmap.os);
};
this.getResult = function() {
return {
ua : this.getUA(),
browser : this.getBrowser(),
engine : this.getEngine(),
os : this.getOS(),
device : this.getDevice(),
cpu : this.getCPU()
};
};
this.getUA = function () {
return ua;
};
this.setUA = function (uastring) {
ua = uastring;
return this;
};
this.setUA(ua);
return this;
};
UAParser.VERSION = LIBVERSION;
UAParser.BROWSER = {
NAME : NAME,
MAJOR : MAJOR, // deprecated
VERSION : VERSION
};
UAParser.CPU = {
ARCHITECTURE : ARCHITECTURE
};
UAParser.DEVICE = {
MODEL : MODEL,
VENDOR : VENDOR,
TYPE : TYPE,
CONSOLE : CONSOLE,
MOBILE : MOBILE,
SMARTTV : SMARTTV,
TABLET : TABLET,
WEARABLE: WEARABLE,
EMBEDDED: EMBEDDED
};
UAParser.ENGINE = {
NAME : NAME,
VERSION : VERSION
};
UAParser.OS = {
NAME : NAME,
VERSION : VERSION
};
///////////
// Export
//////////
// check js environment
if (typeof(exports) !== UNDEF_TYPE) {
// nodejs env
if (typeof module !== UNDEF_TYPE && module.exports) {
exports = module.exports = UAParser;
}
exports.UAParser = UAParser;
} else {
// requirejs env (optional)
if (typeof(define) === FUNC_TYPE && define.amd) {
define(function () {
return UAParser;
});
} else {
// browser env
window.UAParser = UAParser;
}
}
// jQuery/Zepto specific (optional)
// Note:
// In AMD env the global scope should be kept clean, but jQuery is an exception.
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
// and we should catch that.
var $ = window.jQuery || window.Zepto;
if (typeof $ !== UNDEF_TYPE) {
var parser = new UAParser();
$.ua = parser.getResult();
$.ua.get = function() {
return parser.getUA();
};
$.ua.set = function (uastring) {
parser.setUA(uastring);
var result = parser.getResult();
for (var prop in result) {
$.ua[prop] = result[prop];
}
};
}
})(typeof window === 'object' ? window : this);

File diff suppressed because it is too large Load Diff

View File

@@ -1,752 +0,0 @@
[
{
"desc" : "Android Browser on HTC Flyer (P510E)",
"ua" : "Mozilla/5.0 (Linux; U; Android 3.2.1; ru-ru; HTC Flyer P510e Build/HTK75C) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
"expect" :
{
"name" : "Android Browser",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "Android Browser on Huawei Honor Glory II (U9508)",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.4; ru-by; HUAWEI U9508 Build/HuaweiU9508) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 ACHEETAHI/2100050044",
"expect" :
{
"name" : "Android Browser",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "Arora",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-CH) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2",
"expect" :
{
"name" : "Arora",
"version" : "0.2",
"major" : "0"
}
},
{
"desc" : "Avant",
"ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"expect" :
{
"name" : "Avant ",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Baidu",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)",
"expect" :
{
"name" : "baidu",
"version" : "1.x",
"major" : "1"
}
},
{
"desc" : "Bolt",
"ua" : "Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.862 Version/3.0 Safari/523.15",
"expect" :
{
"name" : "Bolt",
"version" : "0.862",
"major" : "0"
}
},
{
"desc" : "Camino",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en; rv:1.9.0.19) Gecko/2011091218 Camino/2.0.9 (like Firefox/3.0.19)",
"expect" :
{
"name" : "Camino",
"version" : "2.0.9",
"major" : "2"
}
},
{
"desc" : "Chimera",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6",
"expect" :
{
"name" : "Chimera",
"version" : "0.6",
"major" : "0"
}
},
{
"desc" : "Chrome",
"ua" : "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6",
"expect" :
{
"name" : "Chrome",
"version" : "20.0.1090.0",
"major" : "20"
}
},
{
"desc" : "Chrome on iOS",
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
"expect" :
{
"name" : "Chrome",
"version" : "19.0.1084.60",
"major" : "19"
}
},
{
"desc" : "Chromium",
"ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.21 Chrome/16.0.912.21 Safari/535.7",
"expect" :
{
"name" : "Chromium",
"version" : "16.0.912.21",
"major" : "16"
}
},
{
"desc" : "Chrome on Android",
"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" :
{
"name" : "Chrome",
"version" : "16.0.912.75",
"major" : "16"
}
},
{
"desc" : "Dillo",
"ua" : "Dillo/2.2",
"expect" :
{
"name" : "Dillo",
"version" : "2.2",
"major" : "2"
}
},
{
"desc" : "Dolphin",
"ua" : "Mozilla/5.0 (SCH-F859/F859DG12;U;NUCLEUS/2.1;Profile/MIDP-2.1 Configuration/CLDC-1.1;480*800;CTC/2.0) Dolfin/2.0",
"expect" :
{
"name" : "Dolphin",
"version" : "2.0",
"major" : "2"
}
},
{
"desc" : "Doris",
"ua" : "Doris/1.15 [en] (Symbian)",
"expect" :
{
"name" : "Doris",
"version" : "1.15",
"major" : "1"
}
},
{
"desc" : "Epiphany",
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
"expect" :
{
"name" : "Epiphany",
"version" : "1.2.6",
"major" : "1"
}
},
{
"desc" : "Firebird",
"ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031007 Firebird/0.7",
"expect" :
{
"name" : "Firebird",
"version" : "0.7",
"major" : "0"
}
},
{
"desc" : "Firefox",
"ua" : "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2",
"expect" :
{
"name" : "Firefox",
"version" : "15.0a2",
"major" : "15"
}
},
{
"desc" : "Fennec",
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
"expect" :
{
"name" : "Fennec",
"version" : "1.0a1",
"major" : "1"
}
},
{
"desc" : "Flock",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0",
"expect" :
{
"name" : "Flock",
"version" : "2.0",
"major" : "2"
}
},
{
"desc" : "GoBrowser",
"ua" : "Nokia5700XpressMusic/GoBrowser/1.6.91",
"expect" :
{
"name" : "GoBrowser",
"version" : "1.6.91",
"major" : "1"
}
},
{
"desc" : "IceApe",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110817 Iceape/2.0.14",
"expect" :
{
"name" : "Iceape",
"version" : "2.0.14",
"major" : "2"
}
},
{
"desc" : "IceCat",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092921 IceCat/3.0.3-g1",
"expect" :
{
"name" : "IceCat",
"version" : "3.0.3-g1",
"major" : "3"
}
},
{
"desc" : "Iceweasel",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.16) Gecko/2009121610 Iceweasel/3.0.6 (Debian-3.0.6-3)",
"expect" :
{
"name" : "Iceweasel",
"version" : "3.0.6",
"major" : "3"
}
},
{
"desc" : "iCab",
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
"expect" :
{
"name" : "iCab",
"version" : "2.9.5",
"major" : "2"
}
},
{
"desc" : "IEMobile",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) 320x240; VZW; Motorola-Q9c; Windows Mobile 6.1 Standard",
"expect" :
{
"name" : "IEMobile",
"version" : "7.11",
"major" : "7"
}
},
{
"desc" : "IE 11 with IE token",
"ua" : "Mozilla/5.0 (IE 11.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
"expect" :
{
"name" : "IE",
"version" : "11.0",
"major" : "11"
}
},
{
"desc" : "IE 11 without IE token",
"ua" : "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko",
"expect" :
{
"name" : "IE",
"version" : "11.0",
"major" : "11"
}
},
{
"desc" : "K-Meleon",
"ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2",
"expect" :
{
"name" : "K-Meleon",
"version" : "0.8.2",
"major" : "0"
}
},
{
"desc" : "Kindle Browser",
"ua" : "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.5 (screen 600x800; rotate)",
"expect" :
{
"name" : "Kindle",
"version" : "2.5",
"major" : "2"
}
},
{
"desc" : "Konqueror",
"ua" : "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; x86_64) KHTML/3.5.6 (like Gecko) (Kubuntu)",
"expect" :
{
"name" : "Konqueror",
"version" : "3.5",
"major" : "3"
}
},
{
"desc" : "Lunascape",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090804 Firefox/3.5.2 Lunascape/5.1.4.5",
"expect" :
{
"name" : "Lunascape",
"version" : "5.1.4.5",
"major" : "5"
}
},
{
"desc" : "Lynx",
"ua" : "Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6b",
"expect" :
{
"name" : "Lynx",
"version" : "2.8.5dev.16",
"major" : "2"
}
},
{
"desc" : "Maemo Browser",
"ua" : "Mozilla/5.0 (X11; U; Linux armv7l; ru-RU; rv:1.9.2.3pre) Gecko/20100723 Firefox/3.5 Maemo Browser 1.7.4.8 RX-51 N900",
"expect" :
{
"name" : "Maemo Browser",
"version" : "1.7.4.8",
"major" : "1"
}
},
{
"desc" : "Maxthon",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)",
"expect" :
{
"name" : "Maxthon",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Midori",
"ua" : "Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+",
"expect" :
{
"name" : "Midori",
"version" : "0.2.2",
"major" : "0"
}
},
{
"desc" : "Minimo",
"ua" : "Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020",
"expect" :
{
"name" : "Minimo",
"version" : "0.020",
"major" : "0"
}
},
{
"desc" : "MIUI Browser on Xiaomi Hongmi WCDMA (HM2013023)",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.2.2; ru-ru; 2013023 Build/HM2013023) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0",
"expect" :
{
"name" : "MIUI Browser",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Mobile Safari",
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7",
"expect" :
{
"name" : "Mobile Safari",
"version" : "4.0.5",
"major" : "4"
}
},
{
"desc" : "Mosaic",
"ua" : "NCSA_Mosaic/2.6 (X11; SunOS 4.1.3 sun4m)",
"expect" :
{
"name" : "Mosaic",
"version" : "2.6",
"major" : "2"
}
},
{
"desc" : "Mozilla",
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606",
"expect" :
{
"name" : "Mozilla",
"version" : "5.0",
"major" : "5"
}
},
{
"desc" : "MSIE",
"ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)",
"expect" :
{
"name" : "IE",
"version" : "5.0b1",
"major" : "5"
}
},
{
"desc" : "NetFront",
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
"expect" :
{
"name" : "NetFront",
"version" : "3.0",
"major" : "3"
}
},
{
"desc" : "Netscape on Windows ME",
"ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0",
"expect" :
{
"name" : "Netscape",
"version" : "9.0",
"major" : "9"
}
},
{
"desc" : "Netscape on Windows 2000",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1",
"expect" :
{
"name" : "Netscape",
"version" : "8.0.1",
"major" : "8"
}
},
{
"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",
"expect" :
{
"name" : "NokiaBrowser",
"version" : "7.3.1.37",
"major" : "7"
}
},
{
"desc" : "OmniWeb",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48",
"expect" :
{
"name" : "OmniWeb",
"version" : "558.48",
"major" : "558"
}
},
{
"desc" : "Opera > 9.80",
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
"expect" :
{
"name" : "Opera",
"version" : "10.10",
"major" : "10"
}
},
{
"desc" : "Opera < 9.80 on Windows",
"ua" : "Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01 [en]",
"expect" :
{
"name" : "Opera",
"version" : "6.01",
"major" : "6"
}
},
{
"desc" : "Opera < 9.80 on OSX",
"ua" : "Opera/8.5 (Macintosh; PPC Mac OS X; U; en)",
"expect" :
{
"name" : "Opera",
"version" : "8.5",
"major" : "8"
}
},
{
"desc" : "Opera Mobile",
"ua" : "Opera/9.80 (Android 2.3.5; Linux; Opera Mobi/ADR-1111101157; U; de) Presto/2.9.201 Version/11.50",
"expect" :
{
"name" : "Opera Mobi",
"version" : "11.50",
"major" : "11"
}
},
{
"desc" : "Opera Webkit",
"ua" : "Mozilla/5.0 AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315",
"expect" :
{
"name" : "Opera",
"version" : "14.0.1025.52315",
"major" : "14"
}
},
{
"desc" : "Opera Mini",
"ua" : "Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25",
"expect" :
{
"name" : "Opera Mini",
"version" : "5.1.21214",
"major" : "5"
}
},
{
"desc" : "Opera Tablet",
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
"expect" :
{
"name" : "Opera Tablet",
"version" : "11.1",
"major" : "11"
}
},
{
"desc" : "PhantomJS",
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34",
"expect" :
{
"name" : "PhantomJS",
"version" : "1.9.2",
"major" : "1"
}
},
{
"desc" : "Phoenix",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4",
"expect" :
{
"name" : "Phoenix",
"version" : "0.4",
"major" : "0"
}
},
{
"desc" : "Polaris",
"ua" : "LG-LX600 Polaris/6.0 MMP/2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1",
"expect" :
{
"name" : "Polaris",
"version" : "6.0",
"major" : "6"
}
},
{
"desc" : "RockMelt",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) RockMelt/0.8.36.78 Chrome/7.0.517.44 Safari/534.7",
"expect" :
{
"name" : "RockMelt",
"version" : "0.8.36.78",
"major" : "0"
}
},
{
"desc" : "Safari",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8",
"expect" :
{
"name" : "Safari",
"version" : "5.0.1",
"major" : "5"
}
},
{
"desc" : "Safari < 3.0",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3",
"expect" :
{
"name" : "Safari",
"version" : "2.0.4",
"major" : "2"
}
},
{
"desc" : "SeaMonkey",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre",
"expect" :
{
"name" : "SeaMonkey",
"version" : "2.0b1pre",
"major" : "2"
}
},
{
"desc" : "Silk Browser",
"ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)",
"expect" :
{
"name" : "Silk",
"version" : "1.1.0-84",
"major" : "1"
}
},
{
"desc" : "Skyfire",
"ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0",
"expect" :
{
"name" : "Skyfire",
"version" : "2.0",
"major" : "2"
}
},
{
"desc" : "SlimBrowser",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)",
"expect" :
{
"name" : "Slim",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Swiftfox",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)",
"expect" :
{
"name" : "Swiftfox",
"version" : "undefined",
"major" : "undefined"
}
},
{
"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",
"expect" :
{
"name" : "Tizen Browser",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "UC Browser on Samsung",
"ua" : "Mozilla/5.0 (Java; U; Pt-br; samsung-gt-s5620) UCBrowser8.2.1.144/69/352/UCWEB Mobile UNTRUSTED/1.0",
"expect" :
{
"name" : "UCBrowser",
"version" : "8.2.1.144",
"major" : "8"
}
},
{
"desc" : "UC Browser on Nokia",
"ua" : "Mozilla/5.0 (S60V3; U; en-in; NokiaN73)/UC Browser8.4.0.159/28/351/UCWEB Mobile",
"expect" :
{
"name" : "UCBrowser",
"version" : "8.4.0.159",
"major" : "8"
}
},
{
"desc" : "UC Browser J2ME",
"ua" : "UCWEB/2.0 (MIDP-2.0; U; zh-CN; HTC EVO 3D X515m) U2/1.0.0 UCBrowser/10.4.0.558 U2/1.0.0 Mobile",
"expect" :
{
"name" : "UCBrowser",
"version" : "10.4.0.558",
"major" : "10"
}
},
{
"desc" : "UC Browser J2ME 2",
"ua" : "JUC (Linux; U; 2.3.5; zh-cn; GT-I9100; 480*800) UCWEB7.9.0.94/139/800",
"expect" :
{
"name" : "UCBrowser",
"version" : "7.9.0.94",
"major" : "7"
}
},
{
"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",
"expect" :
{
"name" : "Vivaldi",
"version" : "1.0.83.38",
"major" : "1"
}
},
{
"desc" : "Yandex",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.0.1084.5402 Chrome/19.0.1084.5402 Safari/536.5",
"expect" :
{
"name" : "Yandex",
"version" : "1.0.1084.5402",
"major" : "1"
}
},
{
"desc" : "Microsoft Edge",
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
"expect" :
{
"name" : "Edge",
"version" : "12.0",
"major" : "12"
}
},
{
"desc" : "Iridium",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/43.8 Safari/537.36 Chrome/43.0.2357.132",
"expect" :
{
"name" : "Iridium",
"version" : "43.8",
"major" : "43"
}
},
{
"desc" : "Firefox iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46",
"expect" :
{
"name" : "Firefox",
"version" : "1.1",
"major" : "1"
}
}
]

View File

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

View File

@@ -1,272 +0,0 @@
[
{
"desc" : "HTC Evo Shift 4G",
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0",
"expect" :
{
"vendor" : "HTC",
"model" : "Evo Shift 4G",
"type" : "mobile"
}
},
{
"desc" : "HTC Nexus 9",
"ua" : "Mozilla/5.0 (Linux; Android 5.0; Nexus 9 Build/LRX21R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Mobile Crosswalk/7.36.154.13 Safari/537.36",
"expect" :
{
"vendor" : "HTC",
"model" : "Nexus 9",
"type" : "tablet"
}
},
{
"desc" : "LG Nexus 4",
"ua" : "Mozilla/5.0 (Linux; Android 4.2.1; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
"expect" :
{
"vendor" : "LG",
"model" : "Nexus 4",
"type" : "mobile"
}
},
{
"desc" : "LG Nexus 5",
"ua" : "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
"expect" :
{
"vendor" : "LG",
"model" : "Nexus 5",
"type" : "mobile"
}
},
{
"desc" : "Motorola Nexus 6",
"ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.20 Mobile Safari/537.36",
"expect" :
{
"vendor" : "Motorola",
"model" : "Nexus 6",
"type" : "mobile"
}
},
{
"desc" : "Motorola Droid RAZR 4G",
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"expect" :
{
"vendor" : "Motorola",
"model" : "DROID RAZR 4G",
"type" : "mobile"
}
},
{
"desc" : "iPhone",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
"expect" :
{
"vendor" : "Apple",
"model" : "iPhone",
"type" : "mobile"
}
},
{
"desc" : "Motorola Droid RAZR 4G",
"ua" : "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53",
"expect" :
{
"vendor" : "Apple",
"model" : "iPod touch",
"type" : "mobile"
}
},
{
"desc" : "Moto X",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.2; xx-xx; XT1058 Build/13.9.0Q2.X-70-GHOST-ATT_LE-2) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect" :
{
"vendor" : "Motorola",
"model" : "XT1058",
"type" : "mobile"
}
},
{
"desc" : "Nokia3xx",
"ua" : "Nokia303/14.87 CLDC-1.1",
"expect" :
{
"vendor" : "Nokia",
"model" : "303",
"type" : "mobile"
}
},
{
"desc" : "Kindle Fire HD",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true",
"expect" :
{
"vendor" : "Amazon",
"model" : "KFTT",
"type" : "tablet"
}
},
{
"desc" : "Samsung SM-T231",
"ua" : "Mozilla/5.0 (Linux; Android 4.4.2; SM-T231 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36",
"expect" :
{
"vendor" : "Samsung",
"model" : "SM-T231",
"type" : "tablet"
}
},
{
"desc" : "Samsung SM-T700",
"ua" : "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36",
"expect" :
{
"vendor" : "Samsung",
"model" : "SM-T700",
"type" : "tablet"
}
},
{
"desc" : "Samsung SM-T520",
"ua" : "Mozilla/5.0 (Linux; Android 4.4.2; SM-T520 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36",
"expect" :
{
"vendor" : "Samsung",
"model" : "SM-T520",
"type" : "tablet"
}
},
{
"desc" : "Sony C5303 (Xperia SP)",
"ua" : "Mozilla/5.0 (Linux; Android 4.3; C5303 Build/12.1.A.1.205) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile Safari/537.36",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Phone",
"type" : "mobile"
}
},
{
"desc" : "Sony SO-02F (Xperia Z1 F)",
"ua" : "Mozilla/5.0 (Linux; Android 4.2.2; SO-02F Build/14.1.H.2.119) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Phone",
"type" : "mobile"
}
},
{
"desc" : "Sony D6653 (Xperia Z3)",
"ua" : "Mozilla/5.0 (Linux; Android 4.4; D6653 Build/23.0.A.0.376) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Phone",
"type" : "mobile"
}
},
{
"desc" : "Sony Xperia SOL25 (ZL2)",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.4; SOL25 Build/17.1.1.C.1.64) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Phone",
"type" : "mobile"
}
},
{
"desc" : "Sony SGP521 (Xperia Z2 Tablet)",
"ua" : "Mozilla/5.0 (Linux; Android 4.4; SGP521 Build/17.1.A.0.432) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Tablet",
"type" : "tablet"
}
},
{
"desc" : "Sony Tablet S",
"ua" : "Mozilla/5.0 (Linux; U; Android 3.1; Sony Tablet S Build/THMAS10000) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Tablet",
"type" : "tablet"
}
},
{
"desc" : "Sony Tablet Z LTE",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.1; SonySGP321 Build/10.2.C.0.143) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
"expect" :
{
"vendor" : "Sony",
"model" : "Xperia Tablet",
"type" : "tablet"
}
},
{
"desc" : "Xiaomi 2013023",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.2.2; en-US; 2013023 Build/HM2013023) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/10.0.1.512 U3/0.8.0 Mobile Safari/533.1",
"expect" :
{
"vendor" : "Xiaomi",
"model" : "2013023",
"type" : "mobile"
}
},
{
"desc" : "Xiaomi Hongmi Note 1W",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-CN; HM NOTE 1W Build/JDQ39) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1",
"expect" :
{
"vendor" : "Xiaomi",
"model" : "HM NOTE 1W",
"type" : "mobile"
}
},
{
"desc" : "Xiaomi Mi 3C",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.3; zh-CN; MI 3C Build/JLS36C) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1",
"expect" :
{
"vendor" : "Xiaomi",
"model" : "MI 3C",
"type" : "mobile"
}
},
{
"desc" : "Xiaomi Mi One Plus",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; MI-ONE Plus Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect" :
{
"vendor" : "Xiaomi",
"model" : "MI-ONE Plus",
"type" : "mobile"
}
},
{
"desc" : "PlayStation 4",
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
"expect" :
{
"vendor" : "Sony",
"model" : "PlayStation 4",
"type" : "console"
}
},
{
"desc" : "Galaxy Nexus",
"ua" : "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19",
"expect" :
{
"vendor" : "Samsung",
"model" : "Galaxy Nexus",
"type" : "mobile"
}
}
]

49
test/dts-test.ts Normal file
View File

@@ -0,0 +1,49 @@
import { expectType } from 'tsd';
import { UAParser, IResult, IBrowser, ICPU, IEngine, IDevice, IOS } from "../src/main/ua-parser";
import { isAppleSilicon, isChromiumBased } from "../src/helpers/ua-parser-helpers";
const uastring = 'Mozilla/5.0 (X11; MyCustomOS; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0';
const extensions = {
os : [
[/(mycustomos)/], [UAParser.OS.NAME, [UAParser.OS.VERSION, '10']]
]
};
const headers = {
'sec-ch-ua-mobile' : '?1'
};
expectType<IResult>(UAParser());
expectType<IResult>(UAParser(uastring));
expectType<IResult>(UAParser(uastring, extensions));
expectType<IResult>(UAParser(uastring, headers));
expectType<IResult>(UAParser(extensions, headers));
expectType<IResult>(UAParser(extensions));
expectType<IResult>(UAParser(headers));
expectType<UAParser>(new UAParser());
const parser = new UAParser(uastring);
const browser = parser.getBrowser();
expectType<IBrowser>(browser);
expectType<string | undefined>(browser.name);
expectType<string | undefined>(browser.version);
expectType<string | undefined>(browser.major);
expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module' | undefined>(browser.type);
expectType<boolean>(browser.is(''));
expectType<string>(browser.toString());
expectType<IBrowser | PromiseLike<IBrowser>>(browser.withClientHints());
expectType<IBrowser>((<IBrowser>browser.withClientHints()).withFeatureCheck());
expectType<boolean>((<IBrowser>browser.withClientHints()).withFeatureCheck().is(''));
expectType<ICPU>(parser.getCPU());
expectType<IDevice>(parser.getDevice());
expectType<IEngine>(parser.getEngine());
expectType<IOS>(parser.getOS());
expectType<IResult>(parser.getResult());
expectType<string>(parser.getUA());
expectType<UAParser>(parser.setUA(uastring));
const result = parser.getResult();
expectType<boolean>(isAppleSilicon(result));
expectType<boolean>(isChromiumBased(result));

View File

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

20
test/jazzer-fuzz-test.js Normal file
View File

@@ -0,0 +1,20 @@
const { FuzzedDataProvider } = require('@jazzer.js/core');
const { UAParser } = require('../src/main/ua-parser');
const UA_MAX_LENGTH = 350;
module.exports.fuzz = function (buffer) {
const data = new FuzzedDataProvider(buffer);
const userAgent = data.consumeString(UA_MAX_LENGTH, 'utf-8', true);
const start = process.hrtime();
UAParser(userAgent);
const elapsed = process.hrtime(start);
const milisec = (elapsed[0]*1e3+elapsed[1]*1e-6).toFixed(3);
if (milisec > 1000) {
throw new Error(
`Potential ReDoS\n` +
`Time taken: ${milisec} ms.\n` +
`User agent: ${userAgent}`);
}
};

26
test/mocha-test-es6.mjs Normal file
View File

@@ -0,0 +1,26 @@
import { UAParser } from '../src/main/ua-parser.mjs';
import { CPU, Device, Engine } from '../src/enums/ua-parser-enums.mjs';
import * as assert from 'assert';
describe('Returns', () => {
it('getResult() should returns object', () => {
assert.deepEqual(new UAParser('').getResult(),
{
ua : '',
browser: { name: undefined, version: undefined, major: undefined, type: undefined },
cpu: { architecture: undefined },
device: { vendor: undefined, model: undefined, type: undefined },
engine: { name: undefined, version: undefined},
os: { name: undefined, version: undefined }
});
});
});
describe('Enums', () => {
it('Can use enum', () => {
const { cpu, device, engine } = UAParser('Mozilla/5.0 (X11; U; Linux armv7l; en-GB; rv:1.9.2a1pre) Gecko/20090928 Firefox/3.5 Maemo Browser 1.4.1.22 RX-51 N900');
assert.strictEqual(cpu.is(CPU.ARM), true);
assert.strictEqual(device.is(Device.MOBILE), true);
assert.strictEqual(engine.is(Engine.GECKO), true);
});
});

View File

@@ -0,0 +1,93 @@
const fs = require('fs');
const assert = require('assert');
const parseJS = require('@babel/parser').parse;
const traverse = require('@babel/traverse').default;
const safe = require('safe-regex');
const { UAParser } = require('../src/main/ua-parser');
const clis = require('./specs/browser-clis.json');
const crawlers = require('./specs/browser-crawlers.json');
const emails = require('./specs/browser-emails.json');
const fetchers = require('./specs/browser-fetchers.json');
const modules = require('./specs/browser-modules.json');
const { CLIs, Crawlers, Emails, Fetchers, Modules } = require('../src/extensions/ua-parser-extensions');
describe('Extensions', () => {
[
['CLIs', clis, CLIs],
['Crawlers', crawlers, Crawlers],
['Emails', emails, Emails],
['Fetchers', fetchers, Fetchers],
['Modules', modules, Modules]
]
.forEach((list) => {
describe(list[0], () => {
list[1].forEach((agent) => {
it(`Can detect ${agent.desc}`, () => {
let browser = UAParser(agent.ua, list[2]).browser;
assert.strictEqual(String(browser.name), agent.expect.name);
assert.strictEqual(String(browser.version), agent.expect.version);
assert.strictEqual(String(browser.type), agent.expect.type);
});
});
});
});
const outlook = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Microsoft Outlook 16.0.9126; Microsoft Outlook 16.0.9126; ms-office; MSOffice 16)';
const thunderbird = 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0';
const axios = 'axios/1.3.5';
const jsdom = 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/20.0.3';
const scrapy = 'Scrapy/1.5.0 (+https://scrapy.org)';
const emailParser = new UAParser(Emails);
assert.deepEqual(emailParser.setUA(outlook).getBrowser(), {name: "Microsoft Outlook", version: "16.0.9126", major: "16", type: "email"});
assert.deepEqual(emailParser.setUA(thunderbird).getBrowser(), {name: "Thunderbird", version: "78.13.0", major: "78", type: "email"});
const moduleParser = new UAParser(Modules);
assert.deepEqual(moduleParser.setUA(axios).getBrowser(), {name: "axios", version: "1.3.5", major: "1", type: "module"});
assert.deepEqual(moduleParser.setUA(jsdom).getBrowser(), {name: "jsdom", version: "20.0.3", major: "20", type: "module"});
assert.deepEqual(moduleParser.setUA(scrapy).getBrowser(), {name: "Scrapy", version: "1.5.0", major: "1", type: "module"});
});
describe('Merge', () => {
it('Can merge multiple extensions', () => {
const wget = 'Wget/1.21.1';
const facebookBot = 'Mozilla/5.0 (compatible; FacebookBot/1.0; +https://developers.facebook.com/docs/sharing/webmasters/facebookbot/)';
// try merging crawlers & CLIs
const crawlersAndCLIs = { browser : [...Crawlers.browser, ...CLIs.browser]};
const crawlersAndCLIsParser = new UAParser(crawlersAndCLIs);
assert.deepEqual(crawlersAndCLIsParser.setUA(wget).getBrowser(), {name: "Wget", version: "1.21.1", major: "1", type:"cli"});
assert.deepEqual(crawlersAndCLIsParser.setUA(facebookBot).getBrowser(), {name: "FacebookBot", version: "1.0", major: "1", type:"crawler"});
// alternative merge options
const crawlersAndCLIsParser2 = new UAParser([Crawlers, CLIs]);
const crawlersAndCLIsParser3 = new UAParser(facebookBot, [Crawlers, CLIs]);
assert.deepEqual(crawlersAndCLIsParser2.setUA(wget).getBrowser(), {name: "Wget", version: "1.21.1", major: "1", type:"cli"});
assert.deepEqual(crawlersAndCLIsParser3.getBrowser(), {name: "FacebookBot", version: "1.0", major: "1", type:"crawler"});
});
});
describe('Testing regexes', () => {
let regexes;
let code = fs.readFileSync('src/extensions/ua-parser-extensions.js', 'utf8').toString();
let ast = parseJS(code, { sourceType: 'script' });
regexes = [];
traverse(ast, {
RegExpLiteral: (path) => {
regexes.push(path.node.pattern);
}
});
if (regexes.length === 0) {
throw new Error('Regexes cannot be empty!');
}
describe('Checking for potentially vulnerable regex', () => {
for (let regex of regexes) {
it('Test against `safe-regex` : ' + regex, () => {
assert.strictEqual(safe(regex), true);
});
}
});
});

View File

@@ -0,0 +1,26 @@
const assert = require('assert');
const { UAParser } = require('../src/main/ua-parser');
const { isAppleSilicon, isChromiumBased } = require('../src/helpers/ua-parser-helpers');
describe('isAppleSilicon', () => {
it('Can detect Apple Silicon device', () => {
// non-real ua
const macARM = 'Mozilla/5.0 (Macintosh; ARM; Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0';
const macIntel = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0';
assert.equal(isAppleSilicon(UAParser(macIntel)), false);
assert.equal(isAppleSilicon(UAParser(macARM)), true);
});
});
describe('isChromiumBased', () => {
it('Can detect Chromium-based browser', () => {
const edge = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.2151.58';
const firefox = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0';
assert.equal(isChromiumBased(UAParser(edge)), true);
assert.equal(isChromiumBased(UAParser(firefox)), false);
});
});

569
test/mocha-test.js Normal file

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -0,0 +1,78 @@
import { test, expect } from '@playwright/test';
import path from 'path';
import url from 'url';
const localHtml = `file://${path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), '../')}/dist/ua-parser.html`;
test.describe('test input', () => {
test.beforeEach(async ({ page }) => {
await page.goto(localHtml);
});
test('accept empty string', async ({ page }) => {
// @ts-ignore
const uap = await page.evaluate(async () => await UAParser(''));
expect(uap).toHaveProperty('ua', '');
});
});
test('read client hints data', async ({ page }) => {
await page.addInitScript(() => {
Object.defineProperty(navigator, 'userAgentData', {
value: {
brands: [],
platform: '',
mobile: false,
getHighEntropyValues: () => {
return Promise.resolve({
brands: [
{
brand: 'Chromium',
version: '110'
},
{
brand: 'Not(A:Brand',
version: '110'
},
{
brand: 'New Browser',
version: '110'
}
],
platform: 'New OS',
formFactors: 'New Form Factor'
});
}
}
});
});
await page.goto(localHtml);
// @ts-ignore
const uap = await page.evaluate(async () => await UAParser().withClientHints());
expect(uap).toHaveProperty('browser.name', 'New Browser');
expect(uap).toHaveProperty('os.name', 'New OS');
expect(uap).toHaveProperty('device.type', undefined);
});
test('detect Brave', async ({ page }) => {
await page.addInitScript(() => {
Object.defineProperty(navigator, 'brave', {
value: {
isBrave: () => true
}
});
});
await page.goto(localHtml);
// @ts-ignore
let uap = await page.evaluate(() => UAParser());
expect(uap).toHaveProperty('browser.name', 'Chrome Headless');
// @ts-ignore
uap = await page.evaluate(() => UAParser().withFeatureCheck());
expect(uap).toHaveProperty('browser.name', 'Brave');
});

2356
test/specs/browser-all.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
[
{
"desc" : "curl",
"ua" : "curl/7.38.0",
"expect" :
{
"name" : "curl",
"version" : "7.38.0",
"type" : "cli"
}
},
{
"desc" : "lynx",
"ua" : "Lynx 2.8.8dev.3",
"expect" :
{
"name" : "Lynx",
"version" : "2.8.8dev.3",
"type" : "cli"
}
},
{
"desc" : "lynx",
"ua" : "Lynx/2.6",
"expect" :
{
"name" : "Lynx",
"version" : "2.6",
"type" : "cli"
}
},
{
"desc" : "wget",
"ua" : "Wget/1.21.1",
"expect" :
{
"name" : "Wget",
"version" : "1.21.1",
"type" : "cli"
}
}
]

View File

@@ -0,0 +1,92 @@
[
{
"desc" : "Applebot",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B410 Safari/600.1.4 (Applebot/0.1;+http://www.apple.com/go/applebot)",
"expect" :
{
"name" : "Applebot",
"version" : "0.1",
"type" : "crawler"
}
},
{
"desc" : "Amazonbot",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 (Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot)",
"expect" :
{
"name" : "Amazonbot",
"version" : "0.1",
"type" : "crawler"
}
},
{
"desc" : "Bytespider",
"ua" : "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.1511.1269 Mobile Safari/537.36; Bytespider",
"expect" :
{
"name" : "Bytespider",
"version" : "undefined",
"type" : "crawler"
}
},
{
"desc" : "ClaudeBot",
"ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)",
"expect" :
{
"name" : "ClaudeBot",
"version" : "1.0",
"type" : "crawler"
}
},
{
"desc" : "ClaudeWeb",
"ua" : "Claude-Web/1.0 (web crawler; +https://www.anthropic.com/; bots@anthropic.com)",
"expect" :
{
"name" : "Claude-Web",
"version" : "1.0",
"type" : "crawler"
}
},
{
"desc" : "FacebookBot",
"ua" : "Mozilla/5.0 (compatible; FacebookBot/1.0; +https://developers.facebook.com/docs/sharing/webmasters/facebookbot/",
"expect" :
{
"name" : "FacebookBot",
"version" : "1.0",
"type" : "crawler"
}
},
{
"desc" : "Googlebot-Video",
"ua" : "Googlebot-Video/1.0",
"expect" :
{
"name" : "Googlebot-Video",
"version" : "1.0",
"type" : "crawler"
}
},
{
"desc" : "GPTBot",
"ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)",
"expect" :
{
"name" : "GPTBot",
"version" : "1.0",
"type" : "crawler"
}
},
{
"desc" : "YandexBot",
"ua" : "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)",
"expect" :
{
"name" : "YandexBot",
"version" : "3.0",
"type" : "crawler"
}
}
]

View File

@@ -0,0 +1,12 @@
[
{
"desc" : "Thunderbird",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0",
"expect" :
{
"name" : "Thunderbird",
"version" : "78.13.0",
"type" : "email"
}
}
]

View File

@@ -0,0 +1,12 @@
[
{
"desc" : "BingPreview",
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b",
"expect" :
{
"name" : "BingPreview",
"version" : "1.0b",
"type" : "fetcher"
}
}
]

View File

@@ -0,0 +1,12 @@
[
{
"desc" : "Scrapy",
"ua" : "Scrapy/1.5.0 (+https://scrapy.org)",
"expect" :
{
"name" : "Scrapy",
"version" : "1.5.0",
"type" : "module"
}
}
]

266
test/specs/cpu-all.json Normal file
View File

@@ -0,0 +1,266 @@
[
{
"desc" : "i686",
"ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "i386",
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "x86-64",
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "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",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "WOW64",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "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",
"expect" :
{
"architecture" : "arm"
}
},
{
"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",
"expect" :
{
"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" : "Google Search App",
"ua" : "Mozilla/5.0 (Linux; Android 6.0; M5s Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.147 Mobile Safari/537.36 GSA/12.40.17.23.arm64",
"expect" :
{
"architecture" : "arm64"
}
},
{
"desc" : "Pocket PC",
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "Mac PowerPC",
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
"expect" :
{
"architecture" : "ppc"
}
},
{
"desc" : "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",
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
"expect" :
{
"architecture" : "sparc"
}
},
{
"desc" : "sparc64",
"ua" : "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)",
"expect" :
{
"architecture" : "sparc64"
}
},
{
"desc" : "QuickTime",
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
"expect" :
{
"architecture" : "ia32"
}
},
{
"desc" : "XBMC",
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
"expect" :
{
"architecture" : "amd64"
}
},
{
"desc" : "IRIX64",
"ua" : "Mozilla/4.8C-SGI [en] (X11; U; IRIX64 6.5 IP27",
"expect" :
{
"architecture" : "irix64"
}
},
{
"desc" : "68k",
"ua" : "'Mozilla/1.1 (Macintosh; U; 68K)'",
"expect" :
{
"architecture" : "68k"
}
}
]

3580
test/specs/device-all.json Normal file

File diff suppressed because it is too large Load Diff

164
test/specs/engine-all.json Normal file
View File

@@ -0,0 +1,164 @@
[
{
"desc" : "Blink",
"ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36",
"expect" :
{
"name" : "Blink",
"version" : "57.0.2987.146"
}
},
{
"desc" : "EdgeHTML",
"ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0",
"expect" :
{
"name" : "EdgeHTML",
"version" : "12.0"
}
},
{
"desc" : "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",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
"expect" :
{
"name" : "Gecko",
"version" : "2.0b9pre"
}
},
{
"desc" : "Goanna",
"ua" : "Mozilla/5.0 (Windows NT 5.1; rv:38.9) Gecko/20100101 Goanna/2.2 Firefox/38.9 PaleMoon/26.5.0",
"expect" :
{
"name" : "Goanna",
"version" : "2.2"
}
},
{
"desc" : "KHTML",
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
"expect" :
{
"name" : "KHTML",
"version" : "4.5.4"
}
},
{
"desc" : "LibWeb",
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
"expect" :
{
"name" : "LibWeb",
"version" : "undefined"
}
},
{
"desc" : "NetFront",
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
"expect" :
{
"name" : "NetFront",
"version" : "3.0"
}
},
{
"desc" : "Presto",
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
"expect" :
{
"name" : "Presto",
"version" : "2.8.149"
}
},
{
"desc" : "Tasman",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)",
"expect" :
{
"name" : "Tasman",
"version" : "1.0"
}
},
{
"desc" : "Trident",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)",
"expect" :
{
"name" : "Trident",
"version" : "6.0"
}
},
{
"desc" : "WebKit",
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
"expect" :
{
"name" : "WebKit",
"version" : "533.19.4"
}
},
{
"desc" : "WebKit",
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/27.0.1453.110 Safari/537.36",
"expect" :
{
"name" : "WebKit",
"version" : "537.36"
}
},
{
"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"
}
}
]

View File

@@ -0,0 +1,342 @@
[{
"desc": "Essential PH-1",
"ua": "Mozilla/5.0 (Linux; Android 9; PH-1 Build/PPR1.180905.036) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36",
"expect": {
"vendor": "Essential",
"model": "PH-1",
"type": "mobile"
}
},
{
"desc": "Gigaset Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Gigaset QV830 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Gigaset",
"model": "QV830",
"type": "tablet"
}
},
{
"desc": "RCA Voyager III Tablet",
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; RCT6973W43 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "RCA",
"model": "RCT6973W43",
"type": "tablet"
}
},
{
"desc": "RCA Voyager II Tablet",
"ua": "Mozilla/5.0 (Linux; Android 5.0; RCT6773W22B Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "RCA",
"model": "RCT6773W22B",
"type": "tablet"
}
},
{
"desc": "Verizon Quanta Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; QMV7B Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Verizon",
"model": "QMV7B",
"type": "tablet"
}
},
{
"desc": "Verizon Ellipsis 8 Tablet",
"ua": "Mozilla/5.0 (Linux; Android 5.1.1; QTAQZ3 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Verizon",
"model": "QTAQZ3",
"type": "tablet"
}
},
{
"desc": "Verizon Ellipsis 8HD Tablet",
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; QTASUN1 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36",
"expect": {
"vendor": "Verizon",
"model": "QTASUN1",
"type": "tablet"
}
},
{
"desc": "Dell Venue 8 Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 8 3830 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Dell",
"model": "Venue 8 3830",
"type": "tablet"
}
},
{
"desc": "Dell Venue 7 Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 7 3730 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Dell",
"model": "Venue 7 3730",
"type": "tablet"
}
},
{
"desc": "Barnes & Noble Nook HD+ Tablet",
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; Barnes & Noble Nook HD+ Build/JZO54K; CyanogenMod-10) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect": {
"vendor": "Barnes & Noble",
"model": "Nook HD+",
"type": "tablet"
}
},
{
"desc": "Barnes & Noble V400 Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36",
"expect": {
"vendor": "Barnes & Noble",
"model": "V400",
"type": "tablet"
}
},
{
"desc": "NuVision TM101A540N Tablet",
"ua": "Mozilla/5.0 (Linux; Android 5.1; TM101A540N Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Safari/537.36",
"expect": {
"vendor": "NuVision",
"model": "TM101A540N",
"type": "tablet"
}
},
{
"desc": "ZTE-Z431",
"ua": "ZTE-Z431/1.4.0 NetFront/4.2 QTV5.1 Profile/MIDP-2.1 Configuration/CLDC-1.1",
"expect": {
"vendor": "ZTE",
"model": "Z431",
"type": "mobile"
}
},
{
"desc": "ZTE",
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; ZTE-Z740G Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect": {
"vendor": "ZTE",
"model": "Z740G",
"type": "mobile"
}
},
{
"desc": "ZTE K Series Tablet",
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; K88 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "ZTE",
"model": "K88",
"type": "tablet"
}
},
{
"desc": "ZTE Nubia Red Magic 3",
"ua": "Mozilla/5.0 (Linux; Android 9; NX629J Build/PKQ1.190321.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/45016 Mobile Safari/537.36 MMWEBID/4064 MicroMessenger/7.0.10.1580(0x27000A34) Process/tools NetType/WIFI Language/zh_CN ABI/arm64",
"expect": {
"vendor": "ZTE",
"model": "NX629J",
"type": "mobile"
}
},
{
"desc": "ZTE Blade A5",
"ua": "Mozilla/5.0 (Linux; Android 9; ZTE Blade A5 2019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36",
"expect": {
"vendor": "ZTE",
"model": "Blade A5 2019",
"type": "mobile"
}
},
{
"desc": "ZTE BLADE V0730",
"ua": "Mozilla/5.0 (Linux; Android 6.0; ZTE BLADE V0730) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36",
"expect": {
"vendor": "ZTE",
"model": "BLADE V0730",
"type": "mobile"
}
},
{
"desc": "ZTE B2017G",
"ua": "Mozilla/5.0 (Linux; Android 7.1.1; ZTE B2017G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36",
"expect": {
"vendor": "ZTE",
"model": "B2017G",
"type": "mobile"
}
},
{
"desc": "Swizz GEN610",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; GEN610 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
"expect": {
"vendor": "Swiss",
"model": "GEN610",
"type": "mobile"
}
},
{
"desc": "Swizz ZUR700",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; ZUR700 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Safari/537.36",
"expect": {
"vendor": "Swiss",
"model": "ZUR700",
"type": "tablet"
}
},
{
"desc": "Zeki TB782b Tablet",
"ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-US; TB782B Build/IMM76D) AppleWebKit/534.31 (KHTML, like Gecko) UCBrowser/9.0.2.299 U3/0.8.0 Mobile Safari/534.31",
"expect": {
"vendor": "Zeki",
"model": "TB782B",
"type": "tablet"
}
},
{
"desc": "Dragon Touch Tablet",
"ua": "Mozilla/5.0 (Linux; Android 4.0.4; DT9138B Build/IMM76D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Mobile Safari/537.36",
"expect": {
"vendor": "Dragon Touch",
"model": "9138B",
"type": "tablet"
}
},
{
"desc": "Insignia Tablet",
"ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; NS-P08A7100 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Insignia",
"model": "NS-P08A7100",
"type": "tablet"
}
},
{
"desc": "Voice Xtreme V75",
"ua": "Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; V75 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect": {
"vendor": "Voice",
"model": "V75",
"type": "mobile"
}
},
{
"desc": "LvTel V11",
"ua": "Mozilla/5.0 (Linux; Android 5.1.1; V11 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36",
"expect": {
"vendor": "LvTel",
"model": "V11",
"type": "mobile"
}
},
{
"desc": "Envizen Tablet V100MD",
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; V100MD Build/V100MD.20130816) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
"expect": {
"vendor": "Envizen",
"model": "V100MD",
"type": "tablet"
}
},
{
"desc": "Rotor Tablet",
"ua": "mozilla/5.0 (linux; android 5.0.1; tu_1491 build/lrx22c) applewebkit/537.36 (khtml, like gecko) chrome/43.0.2357.93 safari/537.36",
"expect": {
"vendor": "Rotor",
"model": "1491",
"type": "tablet"
}
},
{
"desc": "MachSpeed Tablets",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Trio 7.85 vQ Build/Trio_7.85_vQ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36",
"expect": {
"vendor": "MachSpeed",
"model": "Trio 7.85 vQ",
"type": "tablet"
}
},
{
"desc": "Trinity Tablets",
"ua": "Mozilla/5.0 (Linux; Android 5.0.1; Trinity T101 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Safari/537.36",
"expect": {
"vendor": "Trinity",
"model": "T101",
"type": "tablet"
}
},
{
"desc": "NextBook Next7",
"ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Next7P12 Build/IMM76I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
"expect": {
"vendor": "NextBook",
"model": "Next7P12",
"type": "tablet"
}
},
{
"desc": "NextBook Tablets",
"ua": "Mozilla/5.0 (Linux; Android 5.0; NXA8QC116 Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "NextBook",
"model": "NXA8QC116",
"type": "tablet"
}
},
{
"desc": "Le Pan Tablets",
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Le Pan",
"model": "TC802A",
"type": "tablet"
}
},
{
"desc": "Le Pan Tablets",
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"expect": {
"vendor": "Le Pan",
"model": "TC802A",
"type": "tablet"
}
},
{
"desc": "AT&T Radiant Core U304AA",
"ua": "Dalvik/2.1.0 (Linux; U; Android 9; U304AA Build/P00610)",
"expect": {
"vendor": "AT&T",
"model": "U304AA",
"type": "mobile"
}
},
{
"desc": "Vodafone Smart Tab 4G",
"ua": "Mozilla/5.0 (Linux; Android 4.4.4; Vodafone Smart Tab 4G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
"expect": {
"vendor": "Vodafone",
"model": "Smart Tab 4G",
"type": "tablet"
}
},
{
"desc": "Vodafone Smart ultra 6",
"ua": "Mozilla/5.0 (Linux; Android 5.0.2; Vodafone Smart ultra 6 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36",
"expect": {
"vendor": "Vodafone",
"model": "Smart ultra 6",
"type": "tablet"
}
},
{
"desc": "4ife 4K Smart TV Box",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; 4ife 4K Smart TV Box Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36 Vinebre",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "smarttv"
}
}]

View File

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

1244
test/specs/os-all.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,74 +0,0 @@
var assert = require('assert');
var UAParser = require('./../src/ua-parser');
var browsers = require('./browser-test.json');
var cpus = require('./cpu-test.json');
var devices = require('./device-test.json');
var engines = require('./engine-test.json');
var os = require('./os-test.json');
var parser = new UAParser();
var methods = [
{
title : 'getBrowser',
label : 'browser',
list : browsers,
properties : ['name', 'major', 'version']
},
{
title : 'getCPU',
label : 'cpu',
list : cpus,
properties : ['architecture']
},
{
title : 'getDevice',
label : 'device',
list : devices,
properties : ['model', 'type', 'vendor']
},
{
title : 'getEngine',
label : 'engine',
list : engines,
properties : ['name', 'version']
},
{
title : 'getOS',
label : 'os',
list : os,
properties : ['name', 'version']
}];
describe('UAParser()', function () {
var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6';
assert.deepEqual(UAParser(ua), new UAParser().setUA(ua).getResult());
});
describe('Injected Browser', function () {
var uaString = 'ownbrowser/1.3';
var ownBrowser = [[/(ownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];
var parser = new UAParser(uaString, {browser: ownBrowser});
assert.equal(parser.getBrowser().name, 'ownbrowser');
assert.equal(parser.getBrowser().major, '1');
assert.equal(parser.getBrowser().version, '1.3');
});
for (var i in methods) {
describe(methods[i]['title'], function () {
for (var j in methods[i]['list']) {
if (!!methods[i]['list'][j].ua) {
describe('[' + methods[i]['list'][j].desc + ']', function () {
describe('"' + methods[i]['list'][j].ua + '"', function () {
var expect = methods[i]['list'][j].expect;
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
methods[i]['properties'].forEach(function(m) {
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
});
});
});
});
}
}
});
}

View File

@@ -1,32 +0,0 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.7.10",
"description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [
"user-agent",
"parser",
"browser",
"engine",
"os",
"device",
"cpu"
],
"homepage": "https://faisalman.github.com/ua-parser-js",
"author": {
"name": "Faisal Salman",
"email": "fyzlman@gmail.com"
},
"dependencies": {
"jquery": ">=1.5"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
"docs": "https://github.com/faisalman/ua-parser-js",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
}