diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2ba4257..1705fdb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,8 +10,6 @@ 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. @@ -23,11 +21,13 @@ Steps to reproduce the behavior: 4. See error **Expected behavior** -A clear and concise description of what you expected to happen. +A clear and concise description of what you expected to happen, or what's referred in the docs https://docs.uaparser.dev/ **Screenshots** If applicable, add screenshots to help explain your problem. +For issues related to detection results, you can send the screenshots of the demo section at https://uaparser.dev/#demo to confirm. + **Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] @@ -40,4 +40,4 @@ If applicable, add screenshots to help explain your problem. - Version [e.g. 22] **Additional context** -Add any other context about the problem here. +Add any other context about the problem here. \ No newline at end of file diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index cc30afa..0e1966d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,114 @@ # 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'` +## Migrating from v1 to v2 + +### What's Breaking: + +- **Licensing Changes:** + - UAParser.js is now licensed under AGPLv3 for open-source use, with PRO Licenses available for commercial/proprietary use + +- **Browser Detection on Mobile Devices:** + - `"Chrome"` => `"Mobile Chrome"` + - `"Firefox"` => `"Mobile Firefox"` + +- **OS Detection:** + - `"Mac OS"` => `"macOS"` + - `"Chromium OS"` => `"Chrome OS"` + +### What's New: + +- **Support for ES Modules & TypeScript:** + - Import directly as an ES module with TypeScript support: `import { UAParser } from 'ua-parser-js'` + +- **Support for Custom/Predefined Extensions:** + - Pass custom regexes or predefined extensions as a list to `UAParser()` + +- **Support for CLI Parsing:** + - Parse a user-agent directly from the command line using `npx ua-parser-js "[User-Agent]"` + +- **Enhanced Detection with Client Hints:** + - `withClientHints()`: Improves detection accuracy by leveraging client hints + +- **Enhanced Detection with Feature Detection:** + - `withFeatureCheck()`: Refines detection results using feature detection + +- **Simple Comparison for Detection Results:** + - `is()`: Enables easy comparison checks against the detection result + +- **Detailed Result Output:** + - `toString()`: Returns the detection result in form of a full-name string + +- **New Device Type:** + - Added `xr` to identify AR/VR devices + +- **New Browser Property:** + - Added `browser.type` to identify additional browser types: + - `crawler`, `cli`, `email`, `fetcher`, `inapp`, `library`, `mediaplayer` + +- **New Submodules:** + - **`'ua-parser-js/enums'`**: Provides constants for these specific properties: + - `browser.name`, `browser.type`, `cpu.architecture`, `device.type`, `device.vendor`, `engine.name`, `os.name` + + - **`'ua-parser-js/extensions'`**: Predefined extensions for various use cases: + - `Bots`, `Crawlers`, `CLIs`, `Emails`, `ExtraDevices`, `Fetchers`, `InApps`, `Libraries`, `Mediaplayers` + + - **`'ua-parser-js/helpers'`**: Provides utility methods to extend detection functionality: + - `getDeviceVendor()`: Guesses the device vendor based on its model name + - `isAppleSilicon()`: Detects Apple Silicon device properties + - `isBot()`: Checks if the browser is a bot + - `isChromeFamily()`: Checks if the browser is Chrome-based (uses Blink engine) — e.g., New Opera, New Edge, Vivaldi, Brave, Arc, etc. + - `isElectron()`: Detects if current window is running within Electron + - `isFromEU()`: Detects if current browser's timezone is from an EU country + - `isFrozenUA()`: Checks if the user-agent matches a frozen/reduced user-agent pattern + - `isStandalonePWA()`: Detects if current window is a standalone PWA + +--- + +## Version 2.0.0-rc.3 + +- Add support for Headers object +- Add new device: Advan, Cat, Energizer, Honor, IMO, Micromax, Smartfren +- Add new engine: Servo +- `ua-parser-js/extensions` submodule: + - Breaking change: rename `module` to `library` + - Add new email clients: Evolution, KMail, Kontact + - Add new bots: 360Spider, Archive.org Bots, CCBot, DataForSeoBot, DuckAssistBot, Exabot, Google Bots, Meta Bots, MojeekBot, PerplexityBot, PetalBot, TurnitinBot, Yeti, YisouSpider + +## Version 2.0.0-rc.2 + +- Fix incorrect import path in ESM files +- Add new browser: 115, SlimBoat, Slimjet, LibreWolf +- Improve browser detection: 2345, 360, Dragon, Iron, Maxthon +- `ua-parser-js/enums` submodule: + - Add Chromecast OS variants: Android/Fuchsia/Linux/SmartSpeaker +- `ua-parser-js/helpers` submodule: + - Add new method: `isBot()` to check if the browser is identified as a bot + +## Version 2.0.0-rc.1 + +- Fix Python Request mistakenly identified as Meta Quest +- Add new browser: Helio +- Add new device: itel, Nothing, Pico, TCL +- Add new engine: ArkWeb +- Add new OS: OpenHarmony, Pico +- Improve browser detection: Quark +- Improve device detection: Xiaomi, Amazon Echo Show, Google Chromecast, Samsung Galaxy Watch +- `ua-parser-js/helpers` submodule: + - Add new method: + - `getDeviceVendor()` to guess for a device vendor based on its model name + - `isElectron()` to check if current window is running inside Electron + - `isFromEU()` to check if current window is from an EU (European Union) country + - `isStandalonePWA()` to check if current window is a standalone PWA + - Rename `isChromiumBased()` to `isChromeFamily()` + - Update `isAppleSilicon()` to also checks for WebGL renderer info +- `ua-parser-js/extensions` submodule: + - Restore `Bots` as a compilation of all these browser types: `cli`, `crawler`, `fetcher`, and `library` ## 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()` @@ -29,6 +116,7 @@ - Improve browser detection: DuckDuckGo, ICEBrowser, Klar, QQ, Sleipnir - Improve device detection: Oculus Quest & Oppo Pad - Update latest client hints spec: `formFactor` -> `formFactors` +- In `ua-parser-js/extensions` submodule, `bots` divided into `crawler` / `fetcher` ## Version 2.0.0-beta.2 @@ -64,13 +152,15 @@ - 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 +## Version 0.7.38 / 1.0.38 +- Fix error on getOS() when userAgentData.platform is undefined +- Add new browser: Opera GX, Twitter +- Improve browser detection: DuckDuckGo +- Improve device detection: OPPO Pad, Oculus Quest +## Version 0.7.37 / 1.0.37 - Fix misidentified WebView token as device model - Increase UA_MAX_LENGTH to 500 - Add new browser: Alipay, Klarna, Smart Lenovo Browser, Vivo Browser @@ -143,6 +233,10 @@ Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://g - Fix trailing comma for ES3 compatibility - Some code refactor -# Version 0.8 +## Version 0.7 / 1.0 + +Version 1.0.x is basically the equivalent of version 0.7.x (mirror/duplicate). See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion. + +## 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. \ No newline at end of file diff --git a/dist/icons/color/LICENSE.md b/dist/icons/color/LICENSE.md new file mode 100644 index 0000000..c025cd0 --- /dev/null +++ b/dist/icons/color/LICENSE.md @@ -0,0 +1,3 @@ +MIT License +Copyright (c) Cătălin Mariș +https://github.com/alrra/browser-logos \ No newline at end of file diff --git a/dist/icons/color/browser/android-browser.svg b/dist/icons/color/browser/android-browser.svg new file mode 100644 index 0000000..92d5927 --- /dev/null +++ b/dist/icons/color/browser/android-browser.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/avant.png b/dist/icons/color/browser/avant.png new file mode 100644 index 0000000..e0b715d Binary files /dev/null and b/dist/icons/color/browser/avant.png differ diff --git a/dist/icons/color/browser/basilisk.png b/dist/icons/color/browser/basilisk.png new file mode 100644 index 0000000..19a59d6 Binary files /dev/null and b/dist/icons/color/browser/basilisk.png differ diff --git a/dist/icons/color/browser/basilisk.svg b/dist/icons/color/browser/basilisk.svg new file mode 100644 index 0000000..64e1f61 --- /dev/null +++ b/dist/icons/color/browser/basilisk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/brave.png b/dist/icons/color/browser/brave.png new file mode 100644 index 0000000..06fa477 Binary files /dev/null and b/dist/icons/color/browser/brave.png differ diff --git a/dist/icons/color/browser/brave.svg b/dist/icons/color/browser/brave.svg new file mode 100644 index 0000000..fb5ed8b --- /dev/null +++ b/dist/icons/color/browser/brave.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/chrome.png b/dist/icons/color/browser/chrome.png new file mode 100644 index 0000000..f251ad8 Binary files /dev/null and b/dist/icons/color/browser/chrome.png differ diff --git a/dist/icons/color/browser/chrome.svg b/dist/icons/color/browser/chrome.svg new file mode 100644 index 0000000..dcc3b11 --- /dev/null +++ b/dist/icons/color/browser/chrome.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/chromium.png b/dist/icons/color/browser/chromium.png new file mode 100644 index 0000000..7a3cb15 Binary files /dev/null and b/dist/icons/color/browser/chromium.png differ diff --git a/dist/icons/color/browser/chromium.svg b/dist/icons/color/browser/chromium.svg new file mode 100644 index 0000000..97b24f2 --- /dev/null +++ b/dist/icons/color/browser/chromium.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/coc-coc.png b/dist/icons/color/browser/coc-coc.png new file mode 100644 index 0000000..f917dbc Binary files /dev/null and b/dist/icons/color/browser/coc-coc.png differ diff --git a/dist/icons/color/browser/default.png b/dist/icons/color/browser/default.png new file mode 100644 index 0000000..61e01e6 Binary files /dev/null and b/dist/icons/color/browser/default.png differ diff --git a/dist/icons/color/browser/default.svg b/dist/icons/color/browser/default.svg new file mode 100644 index 0000000..4d9afe0 --- /dev/null +++ b/dist/icons/color/browser/default.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/dolphin.png b/dist/icons/color/browser/dolphin.png new file mode 100644 index 0000000..d53805f Binary files /dev/null and b/dist/icons/color/browser/dolphin.png differ diff --git a/dist/icons/color/browser/edge.png b/dist/icons/color/browser/edge.png new file mode 100644 index 0000000..931cb1c Binary files /dev/null and b/dist/icons/color/browser/edge.png differ diff --git a/dist/icons/color/browser/edge.svg b/dist/icons/color/browser/edge.svg new file mode 100644 index 0000000..b2afc8e --- /dev/null +++ b/dist/icons/color/browser/edge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/electron.png b/dist/icons/color/browser/electron.png new file mode 100644 index 0000000..e177990 Binary files /dev/null and b/dist/icons/color/browser/electron.png differ diff --git a/dist/icons/color/browser/electron.svg b/dist/icons/color/browser/electron.svg new file mode 100644 index 0000000..a766fed --- /dev/null +++ b/dist/icons/color/browser/electron.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/falkon.png b/dist/icons/color/browser/falkon.png new file mode 100644 index 0000000..d7fe06d Binary files /dev/null and b/dist/icons/color/browser/falkon.png differ diff --git a/dist/icons/color/browser/falkon.svg b/dist/icons/color/browser/falkon.svg new file mode 100644 index 0000000..0a2e489 --- /dev/null +++ b/dist/icons/color/browser/falkon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/firefox-reality.png b/dist/icons/color/browser/firefox-reality.png new file mode 100644 index 0000000..9a901a4 Binary files /dev/null and b/dist/icons/color/browser/firefox-reality.png differ diff --git a/dist/icons/color/browser/firefox-reality.svg b/dist/icons/color/browser/firefox-reality.svg new file mode 100644 index 0000000..a157540 --- /dev/null +++ b/dist/icons/color/browser/firefox-reality.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/firefox.png b/dist/icons/color/browser/firefox.png new file mode 100644 index 0000000..fc71232 Binary files /dev/null and b/dist/icons/color/browser/firefox.png differ diff --git a/dist/icons/color/browser/firefox.svg b/dist/icons/color/browser/firefox.svg new file mode 100644 index 0000000..f153ced --- /dev/null +++ b/dist/icons/color/browser/firefox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/gsa.svg b/dist/icons/color/browser/gsa.svg new file mode 100644 index 0000000..05d397a --- /dev/null +++ b/dist/icons/color/browser/gsa.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/dist/icons/color/browser/icecat.png b/dist/icons/color/browser/icecat.png new file mode 100644 index 0000000..ad1953a Binary files /dev/null and b/dist/icons/color/browser/icecat.png differ diff --git a/dist/icons/color/browser/ie.svg b/dist/icons/color/browser/ie.svg new file mode 100644 index 0000000..4ac80b3 --- /dev/null +++ b/dist/icons/color/browser/ie.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dist/icons/color/browser/konqueror.png b/dist/icons/color/browser/konqueror.png new file mode 100644 index 0000000..8d28831 Binary files /dev/null and b/dist/icons/color/browser/konqueror.png differ diff --git a/dist/icons/color/browser/konqueror.svg b/dist/icons/color/browser/konqueror.svg new file mode 100644 index 0000000..a65c880 --- /dev/null +++ b/dist/icons/color/browser/konqueror.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/maxthon.png b/dist/icons/color/browser/maxthon.png new file mode 100644 index 0000000..987020e Binary files /dev/null and b/dist/icons/color/browser/maxthon.png differ diff --git a/dist/icons/color/browser/midori.png b/dist/icons/color/browser/midori.png new file mode 100644 index 0000000..681d94f Binary files /dev/null and b/dist/icons/color/browser/midori.png differ diff --git a/dist/icons/color/browser/midori.svg b/dist/icons/color/browser/midori.svg new file mode 100644 index 0000000..66bc085 --- /dev/null +++ b/dist/icons/color/browser/midori.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/netsurf.png b/dist/icons/color/browser/netsurf.png new file mode 100644 index 0000000..0e0e371 Binary files /dev/null and b/dist/icons/color/browser/netsurf.png differ diff --git a/dist/icons/color/browser/netsurf.svg b/dist/icons/color/browser/netsurf.svg new file mode 100644 index 0000000..67aa01b --- /dev/null +++ b/dist/icons/color/browser/netsurf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/opera-gx.png b/dist/icons/color/browser/opera-gx.png new file mode 100644 index 0000000..250cc25 Binary files /dev/null and b/dist/icons/color/browser/opera-gx.png differ diff --git a/dist/icons/color/browser/opera-gx.svg b/dist/icons/color/browser/opera-gx.svg new file mode 100644 index 0000000..aeb51a5 --- /dev/null +++ b/dist/icons/color/browser/opera-gx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/opera-mini.png b/dist/icons/color/browser/opera-mini.png new file mode 100644 index 0000000..bf22003 Binary files /dev/null and b/dist/icons/color/browser/opera-mini.png differ diff --git a/dist/icons/color/browser/opera-touch.png b/dist/icons/color/browser/opera-touch.png new file mode 100644 index 0000000..3beaa36 Binary files /dev/null and b/dist/icons/color/browser/opera-touch.png differ diff --git a/dist/icons/color/browser/opera.png b/dist/icons/color/browser/opera.png new file mode 100644 index 0000000..472a152 Binary files /dev/null and b/dist/icons/color/browser/opera.png differ diff --git a/dist/icons/color/browser/opera.svg b/dist/icons/color/browser/opera.svg new file mode 100644 index 0000000..6e79822 --- /dev/null +++ b/dist/icons/color/browser/opera.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/palemoon.png b/dist/icons/color/browser/palemoon.png new file mode 100644 index 0000000..8696c06 Binary files /dev/null and b/dist/icons/color/browser/palemoon.png differ diff --git a/dist/icons/color/browser/puffin.png b/dist/icons/color/browser/puffin.png new file mode 100644 index 0000000..f511493 Binary files /dev/null and b/dist/icons/color/browser/puffin.png differ diff --git a/dist/icons/color/browser/safari.png b/dist/icons/color/browser/safari.png new file mode 100644 index 0000000..6fe6f54 Binary files /dev/null and b/dist/icons/color/browser/safari.png differ diff --git a/dist/icons/color/browser/safari.svg b/dist/icons/color/browser/safari.svg new file mode 100644 index 0000000..214ccc5 --- /dev/null +++ b/dist/icons/color/browser/safari.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/samsung-internet.png b/dist/icons/color/browser/samsung-internet.png new file mode 100644 index 0000000..543645c Binary files /dev/null and b/dist/icons/color/browser/samsung-internet.png differ diff --git a/dist/icons/color/browser/samsung-internet.svg b/dist/icons/color/browser/samsung-internet.svg new file mode 100644 index 0000000..5b2caa9 --- /dev/null +++ b/dist/icons/color/browser/samsung-internet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/seamonkey.png b/dist/icons/color/browser/seamonkey.png new file mode 100644 index 0000000..5592978 Binary files /dev/null and b/dist/icons/color/browser/seamonkey.png differ diff --git a/dist/icons/color/browser/silk.png b/dist/icons/color/browser/silk.png new file mode 100644 index 0000000..161e5c4 Binary files /dev/null and b/dist/icons/color/browser/silk.png differ diff --git a/dist/icons/color/browser/sogou-mobile.png b/dist/icons/color/browser/sogou-mobile.png new file mode 100644 index 0000000..33bb210 Binary files /dev/null and b/dist/icons/color/browser/sogou-mobile.png differ diff --git a/dist/icons/color/browser/ucbrowser.png b/dist/icons/color/browser/ucbrowser.png new file mode 100644 index 0000000..a7f0f97 Binary files /dev/null and b/dist/icons/color/browser/ucbrowser.png differ diff --git a/dist/icons/color/browser/ucbrowser.svg b/dist/icons/color/browser/ucbrowser.svg new file mode 100644 index 0000000..cb461fb --- /dev/null +++ b/dist/icons/color/browser/ucbrowser.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/vivaldi.png b/dist/icons/color/browser/vivaldi.png new file mode 100644 index 0000000..64f0d32 Binary files /dev/null and b/dist/icons/color/browser/vivaldi.png differ diff --git a/dist/icons/color/browser/vivaldi.svg b/dist/icons/color/browser/vivaldi.svg new file mode 100644 index 0000000..2084b97 --- /dev/null +++ b/dist/icons/color/browser/vivaldi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/webkit.png b/dist/icons/color/browser/webkit.png new file mode 100644 index 0000000..cbc0f1b Binary files /dev/null and b/dist/icons/color/browser/webkit.png differ diff --git a/dist/icons/color/browser/webkit.svg b/dist/icons/color/browser/webkit.svg new file mode 100644 index 0000000..e1ba7d3 --- /dev/null +++ b/dist/icons/color/browser/webkit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/color/browser/yandex.png b/dist/icons/color/browser/yandex.png new file mode 100644 index 0000000..896456d Binary files /dev/null and b/dist/icons/color/browser/yandex.png differ diff --git a/dist/icons/color/os/centos.svg b/dist/icons/color/os/centos.svg new file mode 100644 index 0000000..2338e18 --- /dev/null +++ b/dist/icons/color/os/centos.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/LICENSE.md b/dist/icons/mono/LICENSE.md new file mode 100644 index 0000000..a4c806b --- /dev/null +++ b/dist/icons/mono/LICENSE.md @@ -0,0 +1,3 @@ +CC0-1.0 +https://github.com/simple-icons/simple-icons +https://github.com/coreui/coreui-icons \ No newline at end of file diff --git a/dist/icons/mono/browser/alipay.svg b/dist/icons/mono/browser/alipay.svg new file mode 100644 index 0000000..30fa27f --- /dev/null +++ b/dist/icons/mono/browser/alipay.svg @@ -0,0 +1 @@ +Alipay \ No newline at end of file diff --git a/dist/icons/mono/browser/android-browser.svg b/dist/icons/mono/browser/android-browser.svg new file mode 100644 index 0000000..2482150 --- /dev/null +++ b/dist/icons/mono/browser/android-browser.svg @@ -0,0 +1 @@ +Android Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/avast-secure-browser.svg b/dist/icons/mono/browser/avast-secure-browser.svg new file mode 100644 index 0000000..b77658a --- /dev/null +++ b/dist/icons/mono/browser/avast-secure-browser.svg @@ -0,0 +1 @@ +Avast Secure Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/baidu-browser.svg b/dist/icons/mono/browser/baidu-browser.svg new file mode 100644 index 0000000..f7f0dd1 --- /dev/null +++ b/dist/icons/mono/browser/baidu-browser.svg @@ -0,0 +1 @@ +Baidu Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/brave.svg b/dist/icons/mono/browser/brave.svg new file mode 100644 index 0000000..fa798a4 --- /dev/null +++ b/dist/icons/mono/browser/brave.svg @@ -0,0 +1 @@ +Brave \ No newline at end of file diff --git a/dist/icons/mono/browser/chrome-headless.svg b/dist/icons/mono/browser/chrome-headless.svg new file mode 100644 index 0000000..5fc57d2 --- /dev/null +++ b/dist/icons/mono/browser/chrome-headless.svg @@ -0,0 +1 @@ +Chrome Headless \ No newline at end of file diff --git a/dist/icons/mono/browser/chrome-webview.svg b/dist/icons/mono/browser/chrome-webview.svg new file mode 100644 index 0000000..38b45e3 --- /dev/null +++ b/dist/icons/mono/browser/chrome-webview.svg @@ -0,0 +1 @@ +Chrome Webview \ No newline at end of file diff --git a/dist/icons/mono/browser/chrome.svg b/dist/icons/mono/browser/chrome.svg new file mode 100644 index 0000000..3404d6e --- /dev/null +++ b/dist/icons/mono/browser/chrome.svg @@ -0,0 +1 @@ +Chrome \ No newline at end of file diff --git a/dist/icons/mono/browser/chromium.svg b/dist/icons/mono/browser/chromium.svg new file mode 100644 index 0000000..9060541 --- /dev/null +++ b/dist/icons/mono/browser/chromium.svg @@ -0,0 +1 @@ +Chromium \ No newline at end of file diff --git a/dist/icons/mono/browser/duckduckgo.svg b/dist/icons/mono/browser/duckduckgo.svg new file mode 100644 index 0000000..2f466f4 --- /dev/null +++ b/dist/icons/mono/browser/duckduckgo.svg @@ -0,0 +1 @@ +DuckDuckGo \ No newline at end of file diff --git a/dist/icons/mono/browser/edge.svg b/dist/icons/mono/browser/edge.svg new file mode 100644 index 0000000..958a7ed --- /dev/null +++ b/dist/icons/mono/browser/edge.svg @@ -0,0 +1 @@ +Edge \ No newline at end of file diff --git a/dist/icons/mono/browser/electron.svg b/dist/icons/mono/browser/electron.svg new file mode 100644 index 0000000..8e855ab --- /dev/null +++ b/dist/icons/mono/browser/electron.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/browser/facebook.svg b/dist/icons/mono/browser/facebook.svg new file mode 100644 index 0000000..f66767e --- /dev/null +++ b/dist/icons/mono/browser/facebook.svg @@ -0,0 +1 @@ +Facebook \ No newline at end of file diff --git a/dist/icons/mono/browser/firefox-focus.svg b/dist/icons/mono/browser/firefox-focus.svg new file mode 100644 index 0000000..009082e --- /dev/null +++ b/dist/icons/mono/browser/firefox-focus.svg @@ -0,0 +1 @@ +Firefox Focus \ No newline at end of file diff --git a/dist/icons/mono/browser/firefox-reality.svg b/dist/icons/mono/browser/firefox-reality.svg new file mode 100644 index 0000000..e02dcdf --- /dev/null +++ b/dist/icons/mono/browser/firefox-reality.svg @@ -0,0 +1 @@ +Firefox Reality \ No newline at end of file diff --git a/dist/icons/mono/browser/firefox.svg b/dist/icons/mono/browser/firefox.svg new file mode 100644 index 0000000..baace0b --- /dev/null +++ b/dist/icons/mono/browser/firefox.svg @@ -0,0 +1 @@ +Firefox \ No newline at end of file diff --git a/dist/icons/mono/browser/gsa.svg b/dist/icons/mono/browser/gsa.svg new file mode 100644 index 0000000..753feb5 --- /dev/null +++ b/dist/icons/mono/browser/gsa.svg @@ -0,0 +1 @@ +GSA \ No newline at end of file diff --git a/dist/icons/mono/browser/huawei-browser.svg b/dist/icons/mono/browser/huawei-browser.svg new file mode 100644 index 0000000..200489d --- /dev/null +++ b/dist/icons/mono/browser/huawei-browser.svg @@ -0,0 +1 @@ +Huawei Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/icecat.svg b/dist/icons/mono/browser/icecat.svg new file mode 100644 index 0000000..05b0173 --- /dev/null +++ b/dist/icons/mono/browser/icecat.svg @@ -0,0 +1 @@ +IceCat \ No newline at end of file diff --git a/dist/icons/mono/browser/ie.svg b/dist/icons/mono/browser/ie.svg new file mode 100644 index 0000000..f444f15 --- /dev/null +++ b/dist/icons/mono/browser/ie.svg @@ -0,0 +1 @@ +IE \ No newline at end of file diff --git a/dist/icons/mono/browser/instagram.svg b/dist/icons/mono/browser/instagram.svg new file mode 100644 index 0000000..c0e86b0 --- /dev/null +++ b/dist/icons/mono/browser/instagram.svg @@ -0,0 +1 @@ +Instagram \ No newline at end of file diff --git a/dist/icons/mono/browser/jasmine.svg b/dist/icons/mono/browser/jasmine.svg new file mode 100644 index 0000000..bda1b3e --- /dev/null +++ b/dist/icons/mono/browser/jasmine.svg @@ -0,0 +1 @@ +Jasmine \ No newline at end of file diff --git a/dist/icons/mono/browser/kakaotalk.svg b/dist/icons/mono/browser/kakaotalk.svg new file mode 100644 index 0000000..8e9f9b1 --- /dev/null +++ b/dist/icons/mono/browser/kakaotalk.svg @@ -0,0 +1 @@ +KakaoTalk \ No newline at end of file diff --git a/dist/icons/mono/browser/klarna.svg b/dist/icons/mono/browser/klarna.svg new file mode 100644 index 0000000..c12c2ce --- /dev/null +++ b/dist/icons/mono/browser/klarna.svg @@ -0,0 +1 @@ +Klarna \ No newline at end of file diff --git a/dist/icons/mono/browser/line.svg b/dist/icons/mono/browser/line.svg new file mode 100644 index 0000000..9e4dc98 --- /dev/null +++ b/dist/icons/mono/browser/line.svg @@ -0,0 +1 @@ +LINE \ No newline at end of file diff --git a/dist/icons/mono/browser/linkedin.svg b/dist/icons/mono/browser/linkedin.svg new file mode 100644 index 0000000..caa6e69 --- /dev/null +++ b/dist/icons/mono/browser/linkedin.svg @@ -0,0 +1 @@ +LinkedIn \ No newline at end of file diff --git a/dist/icons/mono/browser/miui-browser.svg b/dist/icons/mono/browser/miui-browser.svg new file mode 100644 index 0000000..a864334 --- /dev/null +++ b/dist/icons/mono/browser/miui-browser.svg @@ -0,0 +1 @@ +MIUI Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/mobile-chrome.svg b/dist/icons/mono/browser/mobile-chrome.svg new file mode 100644 index 0000000..cc67926 --- /dev/null +++ b/dist/icons/mono/browser/mobile-chrome.svg @@ -0,0 +1 @@ +Mobile Chrome \ No newline at end of file diff --git a/dist/icons/mono/browser/mobile-firefox.svg b/dist/icons/mono/browser/mobile-firefox.svg new file mode 100644 index 0000000..b00ccef --- /dev/null +++ b/dist/icons/mono/browser/mobile-firefox.svg @@ -0,0 +1 @@ +Mobile Firefox \ No newline at end of file diff --git a/dist/icons/mono/browser/mobile-safari.svg b/dist/icons/mono/browser/mobile-safari.svg new file mode 100644 index 0000000..ac9eab6 --- /dev/null +++ b/dist/icons/mono/browser/mobile-safari.svg @@ -0,0 +1 @@ +Mobile Safari \ No newline at end of file diff --git a/dist/icons/mono/browser/mozilla.svg b/dist/icons/mono/browser/mozilla.svg new file mode 100644 index 0000000..507eb66 --- /dev/null +++ b/dist/icons/mono/browser/mozilla.svg @@ -0,0 +1 @@ +Mozilla \ No newline at end of file diff --git a/dist/icons/mono/browser/naver.svg b/dist/icons/mono/browser/naver.svg new file mode 100644 index 0000000..611ad4b --- /dev/null +++ b/dist/icons/mono/browser/naver.svg @@ -0,0 +1 @@ +Naver \ No newline at end of file diff --git a/dist/icons/mono/browser/nokia-browser.svg b/dist/icons/mono/browser/nokia-browser.svg new file mode 100644 index 0000000..bf4b85c --- /dev/null +++ b/dist/icons/mono/browser/nokia-browser.svg @@ -0,0 +1 @@ +Nokia Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/oculus-browser.svg b/dist/icons/mono/browser/oculus-browser.svg new file mode 100644 index 0000000..a0d272f --- /dev/null +++ b/dist/icons/mono/browser/oculus-browser.svg @@ -0,0 +1 @@ +Oculus Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-coast.svg b/dist/icons/mono/browser/opera-coast.svg new file mode 100644 index 0000000..f7c88c1 --- /dev/null +++ b/dist/icons/mono/browser/opera-coast.svg @@ -0,0 +1 @@ +Opera Coast \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-gx.svg b/dist/icons/mono/browser/opera-gx.svg new file mode 100644 index 0000000..b560822 --- /dev/null +++ b/dist/icons/mono/browser/opera-gx.svg @@ -0,0 +1 @@ +Opera GX \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-mini.svg b/dist/icons/mono/browser/opera-mini.svg new file mode 100644 index 0000000..1cc6485 --- /dev/null +++ b/dist/icons/mono/browser/opera-mini.svg @@ -0,0 +1 @@ +Opera Mini \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-mobi.svg b/dist/icons/mono/browser/opera-mobi.svg new file mode 100644 index 0000000..dfc1026 --- /dev/null +++ b/dist/icons/mono/browser/opera-mobi.svg @@ -0,0 +1 @@ +Opera Mobi \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-tablet.svg b/dist/icons/mono/browser/opera-tablet.svg new file mode 100644 index 0000000..d47eea2 --- /dev/null +++ b/dist/icons/mono/browser/opera-tablet.svg @@ -0,0 +1 @@ +Opera Tablet \ No newline at end of file diff --git a/dist/icons/mono/browser/opera-touch.svg b/dist/icons/mono/browser/opera-touch.svg new file mode 100644 index 0000000..50211d4 --- /dev/null +++ b/dist/icons/mono/browser/opera-touch.svg @@ -0,0 +1 @@ +Opera Touch \ No newline at end of file diff --git a/dist/icons/mono/browser/opera.svg b/dist/icons/mono/browser/opera.svg new file mode 100644 index 0000000..d1194ee --- /dev/null +++ b/dist/icons/mono/browser/opera.svg @@ -0,0 +1 @@ +Opera \ No newline at end of file diff --git a/dist/icons/mono/browser/qqbrowser.svg b/dist/icons/mono/browser/qqbrowser.svg new file mode 100644 index 0000000..6a94a49 --- /dev/null +++ b/dist/icons/mono/browser/qqbrowser.svg @@ -0,0 +1 @@ +QQBrowser \ No newline at end of file diff --git a/dist/icons/mono/browser/qqbrowserlite.svg b/dist/icons/mono/browser/qqbrowserlite.svg new file mode 100644 index 0000000..d4ccef2 --- /dev/null +++ b/dist/icons/mono/browser/qqbrowserlite.svg @@ -0,0 +1 @@ +QQBrowserLite \ No newline at end of file diff --git a/dist/icons/mono/browser/safari.svg b/dist/icons/mono/browser/safari.svg new file mode 100644 index 0000000..5d15438 --- /dev/null +++ b/dist/icons/mono/browser/safari.svg @@ -0,0 +1 @@ +Safari \ No newline at end of file diff --git a/dist/icons/mono/browser/sailfish-browser.svg b/dist/icons/mono/browser/sailfish-browser.svg new file mode 100644 index 0000000..0884da1 --- /dev/null +++ b/dist/icons/mono/browser/sailfish-browser.svg @@ -0,0 +1 @@ +Sailfish Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/samsung-internet.svg b/dist/icons/mono/browser/samsung-internet.svg new file mode 100644 index 0000000..15e8952 --- /dev/null +++ b/dist/icons/mono/browser/samsung-internet.svg @@ -0,0 +1 @@ +Samsung Internet \ No newline at end of file diff --git a/dist/icons/mono/browser/smart-lenovo-browser.svg b/dist/icons/mono/browser/smart-lenovo-browser.svg new file mode 100644 index 0000000..e9be150 --- /dev/null +++ b/dist/icons/mono/browser/smart-lenovo-browser.svg @@ -0,0 +1 @@ +Smart Lenovo Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/snapchat.svg b/dist/icons/mono/browser/snapchat.svg new file mode 100644 index 0000000..3110fba --- /dev/null +++ b/dist/icons/mono/browser/snapchat.svg @@ -0,0 +1 @@ +Snapchat \ No newline at end of file diff --git a/dist/icons/mono/browser/sogou-explorer.svg b/dist/icons/mono/browser/sogou-explorer.svg new file mode 100644 index 0000000..1449ecb --- /dev/null +++ b/dist/icons/mono/browser/sogou-explorer.svg @@ -0,0 +1 @@ +Sogou Explorer \ No newline at end of file diff --git a/dist/icons/mono/browser/sogou-mobile.svg b/dist/icons/mono/browser/sogou-mobile.svg new file mode 100644 index 0000000..36165fe --- /dev/null +++ b/dist/icons/mono/browser/sogou-mobile.svg @@ -0,0 +1 @@ +Sogou Mobile \ No newline at end of file diff --git a/dist/icons/mono/browser/tesla.svg b/dist/icons/mono/browser/tesla.svg new file mode 100644 index 0000000..77e6601 --- /dev/null +++ b/dist/icons/mono/browser/tesla.svg @@ -0,0 +1 @@ +Tesla \ No newline at end of file diff --git a/dist/icons/mono/browser/tiktok.svg b/dist/icons/mono/browser/tiktok.svg new file mode 100644 index 0000000..57ce3ae --- /dev/null +++ b/dist/icons/mono/browser/tiktok.svg @@ -0,0 +1 @@ +TikTok \ No newline at end of file diff --git a/dist/icons/mono/browser/twitter.svg b/dist/icons/mono/browser/twitter.svg new file mode 100644 index 0000000..b4aeefd --- /dev/null +++ b/dist/icons/mono/browser/twitter.svg @@ -0,0 +1 @@ +Twitter \ No newline at end of file diff --git a/dist/icons/mono/browser/vivaldi.svg b/dist/icons/mono/browser/vivaldi.svg new file mode 100644 index 0000000..167e8ad --- /dev/null +++ b/dist/icons/mono/browser/vivaldi.svg @@ -0,0 +1 @@ +Vivaldi \ No newline at end of file diff --git a/dist/icons/mono/browser/vivo-browser.svg b/dist/icons/mono/browser/vivo-browser.svg new file mode 100644 index 0000000..db52706 --- /dev/null +++ b/dist/icons/mono/browser/vivo-browser.svg @@ -0,0 +1 @@ +vivo Browser \ No newline at end of file diff --git a/dist/icons/mono/browser/wechat.svg b/dist/icons/mono/browser/wechat.svg new file mode 100644 index 0000000..c3eb6c4 --- /dev/null +++ b/dist/icons/mono/browser/wechat.svg @@ -0,0 +1 @@ +WeChat \ No newline at end of file diff --git a/dist/icons/mono/browser/weibo.svg b/dist/icons/mono/browser/weibo.svg new file mode 100644 index 0000000..1394408 --- /dev/null +++ b/dist/icons/mono/browser/weibo.svg @@ -0,0 +1 @@ +Weibo \ No newline at end of file diff --git a/dist/icons/mono/browser/yandex.svg b/dist/icons/mono/browser/yandex.svg new file mode 100644 index 0000000..16a76fe --- /dev/null +++ b/dist/icons/mono/browser/yandex.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/device/acer.svg b/dist/icons/mono/device/acer.svg new file mode 100644 index 0000000..ca9b2bb --- /dev/null +++ b/dist/icons/mono/device/acer.svg @@ -0,0 +1 @@ +Acer \ No newline at end of file diff --git a/dist/icons/mono/device/amazon.svg b/dist/icons/mono/device/amazon.svg new file mode 100644 index 0000000..70316ba --- /dev/null +++ b/dist/icons/mono/device/amazon.svg @@ -0,0 +1 @@ +Amazon \ No newline at end of file diff --git a/dist/icons/mono/device/apple.svg b/dist/icons/mono/device/apple.svg new file mode 100644 index 0000000..de4b0d1 --- /dev/null +++ b/dist/icons/mono/device/apple.svg @@ -0,0 +1 @@ +Apple \ No newline at end of file diff --git a/dist/icons/mono/device/asus.svg b/dist/icons/mono/device/asus.svg new file mode 100644 index 0000000..18ef199 --- /dev/null +++ b/dist/icons/mono/device/asus.svg @@ -0,0 +1 @@ +ASUS \ No newline at end of file diff --git a/dist/icons/mono/device/att.svg b/dist/icons/mono/device/att.svg new file mode 100644 index 0000000..166ca39 --- /dev/null +++ b/dist/icons/mono/device/att.svg @@ -0,0 +1 @@ +AT&T \ No newline at end of file diff --git a/dist/icons/mono/device/blackberry.svg b/dist/icons/mono/device/blackberry.svg new file mode 100644 index 0000000..b0c5583 --- /dev/null +++ b/dist/icons/mono/device/blackberry.svg @@ -0,0 +1 @@ +Blackberry \ No newline at end of file diff --git a/dist/icons/mono/device/dell.svg b/dist/icons/mono/device/dell.svg new file mode 100644 index 0000000..d272bbf --- /dev/null +++ b/dist/icons/mono/device/dell.svg @@ -0,0 +1 @@ +Dell \ No newline at end of file diff --git a/dist/icons/mono/device/facebook.svg b/dist/icons/mono/device/facebook.svg new file mode 100644 index 0000000..f66767e --- /dev/null +++ b/dist/icons/mono/device/facebook.svg @@ -0,0 +1 @@ +Facebook \ No newline at end of file diff --git a/dist/icons/mono/device/fairphone.svg b/dist/icons/mono/device/fairphone.svg new file mode 100644 index 0000000..3262e30 --- /dev/null +++ b/dist/icons/mono/device/fairphone.svg @@ -0,0 +1 @@ +Fairphone \ No newline at end of file diff --git a/dist/icons/mono/device/google.svg b/dist/icons/mono/device/google.svg new file mode 100644 index 0000000..2eaf915 --- /dev/null +++ b/dist/icons/mono/device/google.svg @@ -0,0 +1 @@ +Google \ No newline at end of file diff --git a/dist/icons/mono/device/hp.svg b/dist/icons/mono/device/hp.svg new file mode 100644 index 0000000..04b5f0e --- /dev/null +++ b/dist/icons/mono/device/hp.svg @@ -0,0 +1 @@ +HP \ No newline at end of file diff --git a/dist/icons/mono/device/huawei.svg b/dist/icons/mono/device/huawei.svg new file mode 100644 index 0000000..0c72bab --- /dev/null +++ b/dist/icons/mono/device/huawei.svg @@ -0,0 +1 @@ +Huawei \ No newline at end of file diff --git a/dist/icons/mono/device/lenovo.svg b/dist/icons/mono/device/lenovo.svg new file mode 100644 index 0000000..c03719a --- /dev/null +++ b/dist/icons/mono/device/lenovo.svg @@ -0,0 +1 @@ +Lenovo \ No newline at end of file diff --git a/dist/icons/mono/device/lg.svg b/dist/icons/mono/device/lg.svg new file mode 100644 index 0000000..5eedc79 --- /dev/null +++ b/dist/icons/mono/device/lg.svg @@ -0,0 +1 @@ +LG \ No newline at end of file diff --git a/dist/icons/mono/device/meizu.svg b/dist/icons/mono/device/meizu.svg new file mode 100644 index 0000000..8f903f6 --- /dev/null +++ b/dist/icons/mono/device/meizu.svg @@ -0,0 +1 @@ +Meizu \ No newline at end of file diff --git a/dist/icons/mono/device/microsoft.svg b/dist/icons/mono/device/microsoft.svg new file mode 100644 index 0000000..eeacf25 --- /dev/null +++ b/dist/icons/mono/device/microsoft.svg @@ -0,0 +1 @@ +Microsoft \ No newline at end of file diff --git a/dist/icons/mono/device/motorola.svg b/dist/icons/mono/device/motorola.svg new file mode 100644 index 0000000..3e744bd --- /dev/null +++ b/dist/icons/mono/device/motorola.svg @@ -0,0 +1 @@ +Motorola \ No newline at end of file diff --git a/dist/icons/mono/device/nintendo.svg b/dist/icons/mono/device/nintendo.svg new file mode 100644 index 0000000..5cad964 --- /dev/null +++ b/dist/icons/mono/device/nintendo.svg @@ -0,0 +1 @@ +Nintendo \ No newline at end of file diff --git a/dist/icons/mono/device/nokia.svg b/dist/icons/mono/device/nokia.svg new file mode 100644 index 0000000..a4a2113 --- /dev/null +++ b/dist/icons/mono/device/nokia.svg @@ -0,0 +1 @@ +Nokia \ No newline at end of file diff --git a/dist/icons/mono/device/nvidia.svg b/dist/icons/mono/device/nvidia.svg new file mode 100644 index 0000000..2c7ff66 --- /dev/null +++ b/dist/icons/mono/device/nvidia.svg @@ -0,0 +1 @@ +NVIDIA \ No newline at end of file diff --git a/dist/icons/mono/device/oneplus.svg b/dist/icons/mono/device/oneplus.svg new file mode 100644 index 0000000..11c3131 --- /dev/null +++ b/dist/icons/mono/device/oneplus.svg @@ -0,0 +1 @@ +OnePlus \ No newline at end of file diff --git a/dist/icons/mono/device/oppo.svg b/dist/icons/mono/device/oppo.svg new file mode 100644 index 0000000..b886af3 --- /dev/null +++ b/dist/icons/mono/device/oppo.svg @@ -0,0 +1 @@ +OPPO \ No newline at end of file diff --git a/dist/icons/mono/device/panasonic.svg b/dist/icons/mono/device/panasonic.svg new file mode 100644 index 0000000..e590243 --- /dev/null +++ b/dist/icons/mono/device/panasonic.svg @@ -0,0 +1 @@ +Panasonic \ No newline at end of file diff --git a/dist/icons/mono/device/roku.svg b/dist/icons/mono/device/roku.svg new file mode 100644 index 0000000..17dde5e --- /dev/null +++ b/dist/icons/mono/device/roku.svg @@ -0,0 +1 @@ +Roku \ No newline at end of file diff --git a/dist/icons/mono/device/samsung.svg b/dist/icons/mono/device/samsung.svg new file mode 100644 index 0000000..627cbf2 --- /dev/null +++ b/dist/icons/mono/device/samsung.svg @@ -0,0 +1 @@ +Samsung \ No newline at end of file diff --git a/dist/icons/mono/device/siemens.svg b/dist/icons/mono/device/siemens.svg new file mode 100644 index 0000000..ec60e7b --- /dev/null +++ b/dist/icons/mono/device/siemens.svg @@ -0,0 +1 @@ +Siemens \ No newline at end of file diff --git a/dist/icons/mono/device/sony.svg b/dist/icons/mono/device/sony.svg new file mode 100644 index 0000000..38d17e1 --- /dev/null +++ b/dist/icons/mono/device/sony.svg @@ -0,0 +1 @@ +Sony \ No newline at end of file diff --git a/dist/icons/mono/device/tesla.svg b/dist/icons/mono/device/tesla.svg new file mode 100644 index 0000000..77e6601 --- /dev/null +++ b/dist/icons/mono/device/tesla.svg @@ -0,0 +1 @@ +Tesla \ No newline at end of file diff --git a/dist/icons/mono/device/vivo.svg b/dist/icons/mono/device/vivo.svg new file mode 100644 index 0000000..0591ac4 --- /dev/null +++ b/dist/icons/mono/device/vivo.svg @@ -0,0 +1 @@ +vivo \ No newline at end of file diff --git a/dist/icons/mono/device/vodafone.svg b/dist/icons/mono/device/vodafone.svg new file mode 100644 index 0000000..f882e2f --- /dev/null +++ b/dist/icons/mono/device/vodafone.svg @@ -0,0 +1 @@ +Vodafone \ No newline at end of file diff --git a/dist/icons/mono/device/xiaomi.svg b/dist/icons/mono/device/xiaomi.svg new file mode 100644 index 0000000..f08eae5 --- /dev/null +++ b/dist/icons/mono/device/xiaomi.svg @@ -0,0 +1 @@ +Xiaomi \ No newline at end of file diff --git a/dist/icons/mono/device/zebra.svg b/dist/icons/mono/device/zebra.svg new file mode 100644 index 0000000..8282e77 --- /dev/null +++ b/dist/icons/mono/device/zebra.svg @@ -0,0 +1 @@ +Zebra \ No newline at end of file diff --git a/dist/icons/mono/os/android.svg b/dist/icons/mono/os/android.svg new file mode 100644 index 0000000..3f44ef6 --- /dev/null +++ b/dist/icons/mono/os/android.svg @@ -0,0 +1 @@ +Android \ No newline at end of file diff --git a/dist/icons/mono/os/arch.svg b/dist/icons/mono/os/arch.svg new file mode 100644 index 0000000..a331ef9 --- /dev/null +++ b/dist/icons/mono/os/arch.svg @@ -0,0 +1 @@ +Arch \ No newline at end of file diff --git a/dist/icons/mono/os/blackberry.svg b/dist/icons/mono/os/blackberry.svg new file mode 100644 index 0000000..b0c5583 --- /dev/null +++ b/dist/icons/mono/os/blackberry.svg @@ -0,0 +1 @@ +Blackberry \ No newline at end of file diff --git a/dist/icons/mono/os/centos.svg b/dist/icons/mono/os/centos.svg new file mode 100644 index 0000000..3f16a9e --- /dev/null +++ b/dist/icons/mono/os/centos.svg @@ -0,0 +1 @@ +CentOS \ No newline at end of file diff --git a/dist/icons/mono/os/chrome-os.svg b/dist/icons/mono/os/chrome-os.svg new file mode 100644 index 0000000..0a28262 --- /dev/null +++ b/dist/icons/mono/os/chrome-os.svg @@ -0,0 +1 @@ +Chrome OS \ No newline at end of file diff --git a/dist/icons/mono/os/chromecast.svg b/dist/icons/mono/os/chromecast.svg new file mode 100644 index 0000000..6b251ed --- /dev/null +++ b/dist/icons/mono/os/chromecast.svg @@ -0,0 +1 @@ +Chromecast \ No newline at end of file diff --git a/dist/icons/mono/os/debian.svg b/dist/icons/mono/os/debian.svg new file mode 100644 index 0000000..c983b32 --- /dev/null +++ b/dist/icons/mono/os/debian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/os/deepin.svg b/dist/icons/mono/os/deepin.svg new file mode 100644 index 0000000..2a5fbca --- /dev/null +++ b/dist/icons/mono/os/deepin.svg @@ -0,0 +1 @@ +deepin \ No newline at end of file diff --git a/dist/icons/mono/os/elementary-os.svg b/dist/icons/mono/os/elementary-os.svg new file mode 100644 index 0000000..2b4c951 --- /dev/null +++ b/dist/icons/mono/os/elementary-os.svg @@ -0,0 +1 @@ +elementary OS \ No newline at end of file diff --git a/dist/icons/mono/os/fedora.svg b/dist/icons/mono/os/fedora.svg new file mode 100644 index 0000000..7f461d0 --- /dev/null +++ b/dist/icons/mono/os/fedora.svg @@ -0,0 +1 @@ +Fedora \ No newline at end of file diff --git a/dist/icons/mono/os/firefox.svg b/dist/icons/mono/os/firefox.svg new file mode 100644 index 0000000..e7c9fff --- /dev/null +++ b/dist/icons/mono/os/firefox.svg @@ -0,0 +1 @@ +Firefox \ No newline at end of file diff --git a/dist/icons/mono/os/freebsd.svg b/dist/icons/mono/os/freebsd.svg new file mode 100644 index 0000000..8febe9d --- /dev/null +++ b/dist/icons/mono/os/freebsd.svg @@ -0,0 +1 @@ +FreeBSD \ No newline at end of file diff --git a/dist/icons/mono/os/gentoo.svg b/dist/icons/mono/os/gentoo.svg new file mode 100644 index 0000000..4c48a02 --- /dev/null +++ b/dist/icons/mono/os/gentoo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/os/gnu.svg b/dist/icons/mono/os/gnu.svg new file mode 100644 index 0000000..f29f4d7 --- /dev/null +++ b/dist/icons/mono/os/gnu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/icons/mono/os/harmonyos.svg b/dist/icons/mono/os/harmonyos.svg new file mode 100644 index 0000000..99b8d7e --- /dev/null +++ b/dist/icons/mono/os/harmonyos.svg @@ -0,0 +1 @@ +HarmonyOS \ No newline at end of file diff --git a/dist/icons/mono/os/ios.svg b/dist/icons/mono/os/ios.svg new file mode 100644 index 0000000..a163697 --- /dev/null +++ b/dist/icons/mono/os/ios.svg @@ -0,0 +1 @@ +iOS \ No newline at end of file diff --git a/dist/icons/mono/os/kaios.svg b/dist/icons/mono/os/kaios.svg new file mode 100644 index 0000000..27a0ec7 --- /dev/null +++ b/dist/icons/mono/os/kaios.svg @@ -0,0 +1 @@ +KaiOS \ No newline at end of file diff --git a/dist/icons/mono/os/linux.svg b/dist/icons/mono/os/linux.svg new file mode 100644 index 0000000..381d3d8 --- /dev/null +++ b/dist/icons/mono/os/linux.svg @@ -0,0 +1 @@ +Linux \ No newline at end of file diff --git a/dist/icons/mono/os/macos.svg b/dist/icons/mono/os/macos.svg new file mode 100644 index 0000000..87630c4 --- /dev/null +++ b/dist/icons/mono/os/macos.svg @@ -0,0 +1 @@ +macOS \ No newline at end of file diff --git a/dist/icons/mono/os/manjaro.svg b/dist/icons/mono/os/manjaro.svg new file mode 100644 index 0000000..d99972e --- /dev/null +++ b/dist/icons/mono/os/manjaro.svg @@ -0,0 +1 @@ +Manjaro \ No newline at end of file diff --git a/dist/icons/mono/os/mint.svg b/dist/icons/mono/os/mint.svg new file mode 100644 index 0000000..442c8b2 --- /dev/null +++ b/dist/icons/mono/os/mint.svg @@ -0,0 +1 @@ +Mint \ No newline at end of file diff --git a/dist/icons/mono/os/netbsd.svg b/dist/icons/mono/os/netbsd.svg new file mode 100644 index 0000000..511f066 --- /dev/null +++ b/dist/icons/mono/os/netbsd.svg @@ -0,0 +1 @@ +NetBSD \ No newline at end of file diff --git a/dist/icons/mono/os/nintendo.svg b/dist/icons/mono/os/nintendo.svg new file mode 100644 index 0000000..5cad964 --- /dev/null +++ b/dist/icons/mono/os/nintendo.svg @@ -0,0 +1 @@ +Nintendo \ No newline at end of file diff --git a/dist/icons/mono/os/openbsd.svg b/dist/icons/mono/os/openbsd.svg new file mode 100644 index 0000000..e78fbc7 --- /dev/null +++ b/dist/icons/mono/os/openbsd.svg @@ -0,0 +1 @@ +OpenBSD \ No newline at end of file diff --git a/dist/icons/mono/os/playstation.svg b/dist/icons/mono/os/playstation.svg new file mode 100644 index 0000000..be33703 --- /dev/null +++ b/dist/icons/mono/os/playstation.svg @@ -0,0 +1 @@ +PlayStation \ No newline at end of file diff --git a/dist/icons/mono/os/raspbian.svg b/dist/icons/mono/os/raspbian.svg new file mode 100644 index 0000000..de6feed --- /dev/null +++ b/dist/icons/mono/os/raspbian.svg @@ -0,0 +1 @@ +Raspbian \ No newline at end of file diff --git a/dist/icons/mono/os/redhat.svg b/dist/icons/mono/os/redhat.svg new file mode 100644 index 0000000..b68e413 --- /dev/null +++ b/dist/icons/mono/os/redhat.svg @@ -0,0 +1 @@ +RedHat \ No newline at end of file diff --git a/dist/icons/mono/os/sailfish.svg b/dist/icons/mono/os/sailfish.svg new file mode 100644 index 0000000..b695e10 --- /dev/null +++ b/dist/icons/mono/os/sailfish.svg @@ -0,0 +1 @@ +Sailfish \ No newline at end of file diff --git a/dist/icons/mono/os/slackware.svg b/dist/icons/mono/os/slackware.svg new file mode 100644 index 0000000..611bf80 --- /dev/null +++ b/dist/icons/mono/os/slackware.svg @@ -0,0 +1 @@ +Slackware \ No newline at end of file diff --git a/dist/icons/mono/os/suse.svg b/dist/icons/mono/os/suse.svg new file mode 100644 index 0000000..a4e474a --- /dev/null +++ b/dist/icons/mono/os/suse.svg @@ -0,0 +1 @@ +SUSE \ No newline at end of file diff --git a/dist/icons/mono/os/ubuntu.svg b/dist/icons/mono/os/ubuntu.svg new file mode 100644 index 0000000..227f86a --- /dev/null +++ b/dist/icons/mono/os/ubuntu.svg @@ -0,0 +1 @@ +Ubuntu \ No newline at end of file diff --git a/dist/icons/mono/os/windows.svg b/dist/icons/mono/os/windows.svg new file mode 100644 index 0000000..9c79dff --- /dev/null +++ b/dist/icons/mono/os/windows.svg @@ -0,0 +1 @@ +Windows 10 \ No newline at end of file diff --git a/dist/icons/mono/os/xbox.svg b/dist/icons/mono/os/xbox.svg new file mode 100644 index 0000000..85a9689 --- /dev/null +++ b/dist/icons/mono/os/xbox.svg @@ -0,0 +1 @@ +Xbox \ No newline at end of file diff --git a/dist/ua-parser.min.js b/dist/ua-parser.min.js index c4f6d6a..a1eadda 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -1,4 +1,4 @@ -/* UAParser.js v2.0.0-beta.3 +/* UAParser.js v2.0.0-rc.3 Copyright © 2012-2024 Faisal Salman UAParser.js PRO Personal License */ -(function(window,undefined){"use strict";var LIBVERSION="2.0.0-beta.3",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",USER_AGENT="user-agent",UA_MAX_LENGTH=500,BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTORS=CH_HEADER+"-form-factors",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",WINDOWS="Windows";var isWindow=typeof window!==UNDEF_TYPE,NAVIGATOR=isWindow&&window.navigator?window.navigator:undefined,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:undefined;var extend=function(defaultRgx,extensions){var mergedRgx={};var extraRgx=extensions;if(!isExtensions(extensions)){extraRgx={};for(var i in extensions){for(var j in extensions[i]){extraRgx[j]=extensions[i][j].concat(extraRgx[j]?extraRgx[j]:[])}}}for(var k in defaultRgx){mergedRgx[k]=extraRgx[k]&&extraRgx[k].length%2===0?extraRgx[k].concat(defaultRgx[k]):defaultRgx[k]}return mergedRgx},enumerize=function(arr){var enums={};for(var i=0;i0){for(var i in str1){if(lowerize(str1[i])==lowerize(str2))return true}return false}return isString(str1)?lowerize(str2).indexOf(lowerize(str1))!==-1:false},isExtensions=function(obj,deep){for(var prop in obj){return/^(browser|cpu|device|engine|os)$/.test(prop)||(deep?isExtensions(obj[prop]):false)}},isString=function(val){return typeof val===STR_TYPE},itemListToArray=function(header){if(!header)return undefined;var arr=[];var tokens=strip(/\\?\"/g,header).split(",");for(var i=0;i-1){var token=trim(tokens[i]).split(";v=");arr[i]={brand:token[0],version:token[1]}}else{arr[i]=trim(tokens[i])}}return arr},lowerize=function(str){return isString(str)?str.toLowerCase():str},majorize=function(version){return isString(version)?strip(/[^\d\.]/g,version).split(".")[0]:undefined},setProps=function(arr){for(var i in arr){var propName=arr[i];if(typeof propName==OBJ_TYPE&&propName.length==2){this[propName[0]]=propName[1]}else{this[propName]=undefined}}return this},strip=function(pattern,str){return isString(str)?str.replace(pattern,EMPTY):str},stripQuotes=function(str){return strip(/\\?\"/g,str)},trim=function(str,len){if(isString(str)){str=strip(/^\s\s*/,str);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){if(!ua||!arrays)return;var i=0,j,k,p,q,matches,match;while(i0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j2){this.set(MODEL,"iPad").set(TYPE,TABLET)}break;case UA_OS:if(!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]){this.set(NAME,NAVIGATOR_UADATA[PLATFORM])}break;case UA_RESULT:var data=this.data;var detect=function(itemType){return data[itemType].getItem().detectFeature().get()};this.set(UA_BROWSER,detect(UA_BROWSER)).set(UA_CPU,detect(UA_CPU)).set(UA_DEVICE,detect(UA_DEVICE)).set(UA_ENGINE,detect(UA_ENGINE)).set(UA_OS,detect(UA_OS))}}return this};this.parseUA=function(){if(this.itemType!=UA_RESULT){rgxMapper.call(this.data,this.ua,this.rgxMap)}if(this.itemType==UA_BROWSER){this.set(MAJOR,majorize(this.get(VERSION)))}return this};this.parseCH=function(){var uaCH=this.uaCH,rgxMap=this.rgxMap;switch(this.itemType){case UA_BROWSER:var brands=uaCH[FULLVERLIST]||uaCH[BRANDS],prevName;if(brands){for(var i in brands){var brandName=strip(/(Google|Microsoft) /,brands[i].brand||brands[i]),brandVersion=brands[i].version;if(!/not.a.brand/i.test(brandName)&&(!prevName||/chrom/i.test(prevName)&&!/chromi/i.test(brandName))){this.set(NAME,brandName).set(VERSION,brandVersion).set(MAJOR,majorize(brandVersion));prevName=brandName}}}break;case UA_CPU:var archName=uaCH[ARCHITECTURE];if(archName){if(archName&&uaCH[BITNESS]=="64")archName+="64";rgxMapper.call(this.data,archName+";",rgxMap)}break;case UA_DEVICE:if(uaCH[MOBILE]){this.set(TYPE,MOBILE)}if(uaCH[MODEL]){this.set(MODEL,uaCH[MODEL])}if(uaCH[MODEL]=="Xbox"){this.set(TYPE,CONSOLE).set(VENDOR,MICROSOFT)}if(uaCH[FORMFACTORS]){var ff;if(typeof uaCH[FORMFACTORS]!=="string"){var idx=0;while(!ff&&idx=13?"11":"10";this.set(NAME,osName).set(VERSION,osVersion)}if(this.get(NAME)==WINDOWS&&uaCH[MODEL]=="Xbox"){this.set(NAME,"Xbox").set(VERSION,undefined)}break;case UA_RESULT:var data=this.data;var parse=function(itemType){return data[itemType].getItem().setCH(uaCH).parseCH().get()};this.set(UA_BROWSER,parse(UA_BROWSER)).set(UA_CPU,parse(UA_CPU)).set(UA_DEVICE,parse(UA_DEVICE)).set(UA_ENGINE,parse(UA_ENGINE)).set(UA_OS,parse(UA_OS))}return this};setProps.call(this,[["itemType",itemType],["ua",ua],["uaCH",uaCH],["rgxMap",rgxMap],["data",createIData(this,itemType)]]);return this}function UAParser(ua,extensions,headers){if(typeof ua===OBJ_TYPE){if(isExtensions(ua,true)){if(typeof extensions===OBJ_TYPE){headers=extensions}extensions=ua}else{headers=ua;extensions=undefined}ua=undefined}else if(typeof ua===STR_TYPE&&!isExtensions(extensions,true)){headers=extensions;extensions=undefined}if(!(this instanceof UAParser)){return new UAParser(ua,extensions,headers).getResult()}var userAgent=typeof ua===STR_TYPE?ua:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:headers&&headers[USER_AGENT]?headers[USER_AGENT]:EMPTY,httpUACH=new UACHData(headers,true),regexMap=extensions?extend(defaultRegexes,extensions):defaultRegexes,createItemFunc=function(itemType){if(itemType==UA_RESULT){return function(){return new UAItem(itemType,userAgent,regexMap,httpUACH).set("ua",userAgent).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}}else{return function(){return new UAItem(itemType,userAgent,regexMap[itemType],httpUACH).parseUA().get()}}};setProps.call(this,[["getBrowser",createItemFunc(UA_BROWSER)],["getCPU",createItemFunc(UA_CPU)],["getDevice",createItemFunc(UA_DEVICE)],["getEngine",createItemFunc(UA_ENGINE)],["getOS",createItemFunc(UA_OS)],["getResult",createItemFunc(UA_RESULT)],["getUA",function(){return userAgent}],["setUA",function(ua){if(isString(ua))userAgent=ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this}]]).setUA(userAgent);return this}UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR,TYPE]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define===FUNC_TYPE&&define.amd){define(function(){return UAParser})}else if(isWindow){window.UAParser=UAParser}}var $=isWindow&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file +(function(window,undefined){"use strict";var LIBVERSION="2.0.0-rc.3",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",USER_AGENT="user-agent",UA_MAX_LENGTH=500,BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTORS=CH_HEADER+"-form-factors",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",CHROME="Chrome",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",WINDOWS="Windows";var isWindow=typeof window!==UNDEF_TYPE,NAVIGATOR=isWindow&&window.navigator?window.navigator:undefined,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:undefined;var extend=function(defaultRgx,extensions){var mergedRgx={};var extraRgx=extensions;if(!isExtensions(extensions)){extraRgx={};for(var i in extensions){for(var j in extensions[i]){extraRgx[j]=extensions[i][j].concat(extraRgx[j]?extraRgx[j]:[])}}}for(var k in defaultRgx){mergedRgx[k]=extraRgx[k]&&extraRgx[k].length%2===0?extraRgx[k].concat(defaultRgx[k]):defaultRgx[k]}return mergedRgx},enumerize=function(arr){var enums={};for(var i=0;i0){for(var i in str1){if(lowerize(str1[i])==lowerize(str2))return true}return false}return isString(str1)?lowerize(str2).indexOf(lowerize(str1))!==-1:false},isExtensions=function(obj,deep){for(var prop in obj){return/^(browser|cpu|device|engine|os)$/.test(prop)||(deep?isExtensions(obj[prop]):false)}},isString=function(val){return typeof val===STR_TYPE},itemListToArray=function(header){if(!header)return undefined;var arr=[];var tokens=strip(/\\?\"/g,header).split(",");for(var i=0;i-1){var token=trim(tokens[i]).split(";v=");arr[i]={brand:token[0],version:token[1]}}else{arr[i]=trim(tokens[i])}}return arr},lowerize=function(str){return isString(str)?str.toLowerCase():str},majorize=function(version){return isString(version)?strip(/[^\d\.]/g,version).split(".")[0]:undefined},setProps=function(arr){for(var i in arr){var propName=arr[i];if(typeof propName==OBJ_TYPE&&propName.length==2){this[propName[0]]=propName[1]}else{this[propName]=undefined}}return this},strip=function(pattern,str){return isString(str)?str.replace(pattern,EMPTY):str},stripQuotes=function(str){return strip(/\\?\"/g,str)},trim=function(str,len){if(isString(str)){str=strip(/^\s\s*/,str);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){if(!ua||!arrays)return;var i=0,j,k,p,q,matches,match;while(i0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j2){this.set(MODEL,"iPad").set(TYPE,TABLET)}break;case UA_OS:if(!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]){this.set(NAME,NAVIGATOR_UADATA[PLATFORM])}break;case UA_RESULT:var data=this.data;var detect=function(itemType){return data[itemType].getItem().detectFeature().get()};this.set(UA_BROWSER,detect(UA_BROWSER)).set(UA_CPU,detect(UA_CPU)).set(UA_DEVICE,detect(UA_DEVICE)).set(UA_ENGINE,detect(UA_ENGINE)).set(UA_OS,detect(UA_OS))}}return this};this.parseUA=function(){if(this.itemType!=UA_RESULT){rgxMapper.call(this.data,this.ua,this.rgxMap)}if(this.itemType==UA_BROWSER){this.set(MAJOR,majorize(this.get(VERSION)))}return this};this.parseCH=function(){var uaCH=this.uaCH,rgxMap=this.rgxMap;switch(this.itemType){case UA_BROWSER:var brands=uaCH[FULLVERLIST]||uaCH[BRANDS],prevName;if(brands){for(var i in brands){var brandName=strip(/(Google|Microsoft) /,brands[i].brand||brands[i]),brandVersion=brands[i].version;if(!/not.a.brand/i.test(brandName)&&(!prevName||/chrom/i.test(prevName)&&!/chromi/i.test(brandName))){this.set(NAME,brandName).set(VERSION,brandVersion).set(MAJOR,majorize(brandVersion));prevName=brandName}}}break;case UA_CPU:var archName=uaCH[ARCHITECTURE];if(archName){if(archName&&uaCH[BITNESS]=="64")archName+="64";rgxMapper.call(this.data,archName+";",rgxMap)}break;case UA_DEVICE:if(uaCH[MOBILE]){this.set(TYPE,MOBILE)}if(uaCH[MODEL]){this.set(MODEL,uaCH[MODEL])}if(uaCH[MODEL]=="Xbox"){this.set(TYPE,CONSOLE).set(VENDOR,MICROSOFT)}if(uaCH[FORMFACTORS]){var ff;if(typeof uaCH[FORMFACTORS]!=="string"){var idx=0;while(!ff&&idx=13?"11":"10";this.set(NAME,osName).set(VERSION,osVersion)}if(this.get(NAME)==WINDOWS&&uaCH[MODEL]=="Xbox"){this.set(NAME,"Xbox").set(VERSION,undefined)}break;case UA_RESULT:var data=this.data;var parse=function(itemType){return data[itemType].getItem().setCH(uaCH).parseCH().get()};this.set(UA_BROWSER,parse(UA_BROWSER)).set(UA_CPU,parse(UA_CPU)).set(UA_DEVICE,parse(UA_DEVICE)).set(UA_ENGINE,parse(UA_ENGINE)).set(UA_OS,parse(UA_OS))}return this};setProps.call(this,[["itemType",itemType],["ua",ua],["uaCH",uaCH],["rgxMap",rgxMap],["data",createIData(this,itemType)]]);return this}function UAParser(ua,extensions,headers){if(typeof ua===OBJ_TYPE){if(isExtensions(ua,true)){if(typeof extensions===OBJ_TYPE){headers=extensions}extensions=ua}else{headers=ua;extensions=undefined}ua=undefined}else if(typeof ua===STR_TYPE&&!isExtensions(extensions,true)){headers=extensions;extensions=undefined}if(headers&&typeof headers.append===FUNC_TYPE){var kv={};headers.forEach(function(v,k){kv[k]=v});headers=kv}if(!(this instanceof UAParser)){return new UAParser(ua,extensions,headers).getResult()}var userAgent=typeof ua===STR_TYPE?ua:headers&&headers[USER_AGENT]?headers[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,httpUACH=new UACHData(headers,true),regexMap=extensions?extend(defaultRegexes,extensions):defaultRegexes,createItemFunc=function(itemType){if(itemType==UA_RESULT){return function(){return new UAItem(itemType,userAgent,regexMap,httpUACH).set("ua",userAgent).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}}else{return function(){return new UAItem(itemType,userAgent,regexMap[itemType],httpUACH).parseUA().get()}}};setProps.call(this,[["getBrowser",createItemFunc(UA_BROWSER)],["getCPU",createItemFunc(UA_CPU)],["getDevice",createItemFunc(UA_DEVICE)],["getEngine",createItemFunc(UA_ENGINE)],["getOS",createItemFunc(UA_OS)],["getResult",createItemFunc(UA_RESULT)],["getUA",function(){return userAgent}],["setUA",function(ua){if(isString(ua))userAgent=ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this}]]).setUA(userAgent);return this}UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR,TYPE]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define===FUNC_TYPE&&define.amd){define(function(){return UAParser})}else if(isWindow){window.UAParser=UAParser}}var $=isWindow&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file diff --git a/dist/ua-parser.pack.js b/dist/ua-parser.pack.js index 2fe5806..aad37a2 100644 --- a/dist/ua-parser.pack.js +++ b/dist/ua-parser.pack.js @@ -1,4 +1,4 @@ -/* UAParser.js v2.0.0-beta.3 +/* UAParser.js v2.0.0-rc.3 Copyright © 2012-2024 Faisal Salman UAParser.js PRO Personal License */ -!function(i,c){"use strict";function e(i){for(var e={},t=0;t_?Si(i,_):i),this}]]).setUA(o),this}Ui.VERSION="2.0.0-beta.3",Ui.BROWSER=e([f,v,p,m]),Ui.CPU=e([x]),Ui.DEVICE=e([h,g,m,k,y,t,r,o,a]),Ui.ENGINE=Ui.OS=e([f,v]),typeof exports!==b?(typeof module!==b&&module.exports&&(exports=module.exports=Ui),exports.UAParser=Ui):typeof define===u&&define.amd?define(function(){return Ui}):ui&&(i.UAParser=Ui);var Hi,Ei=ui&&(i.jQuery||i.Zepto);Ei&&!Ei.ua&&(Hi=new Ui,Ei.ua=Hi.getResult(),Ei.ua.get=function(){return Hi.getUA()},Ei.ua.set=function(i){Hi.setUA(i);var e,t=Hi.getResult();for(e in t)Ei.ua[e]=t[e]})}("object"==typeof window?window:this); \ No newline at end of file +!function(i,d){"use strict";function e(i){for(var e={},t=0;tC?Ci(i,C):i),this}]]).setUA(r),this}Ui.VERSION="2.0.0-rc.3",Ui.BROWSER=e([m,v,p,f]),Ui.CPU=e([k]),Ui.DEVICE=e([h,g,f,x,y,t,r,o,s]),Ui.ENGINE=Ui.OS=e([m,v]),typeof exports!==b?(typeof module!==b&&module.exports&&(exports=module.exports=Ui),exports.UAParser=Ui):typeof define===u&&define.amd?define(function(){return Ui}):li&&(i.UAParser=Ui);var ji,Ei=li&&(i.jQuery||i.Zepto);Ei&&!Ei.ua&&(ji=new Ui,Ei.ua=ji.getResult(),Ei.ua.get=function(){return ji.getUA()},Ei.ua.set=function(i){ji.setUA(i);var e,t=ji.getResult();for(e in t)Ei.ua[e]=t[e]})}("object"==typeof window?window:this); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7a1c6f9..f15fe7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ua-parser-js/pro-personal", - "version": "2.0.0-beta.3", + "version": "2.0.0-rc.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ua-parser-js/pro-personal", - "version": "2.0.0-beta.3", + "version": "2.0.0-rc.3", "funding": [ { "type": "opencollective", @@ -21,7 +21,12 @@ "url": "https://github.com/sponsors/faisalman" } ], - "license": "UAParser.js-PRO-Personal", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "detect-europe-js": "^0.1.2", + "is-standalone-pwa": "^0.1.1", + "ua-is-frozen": "^0.1.2" + }, "bin": { "pro-personal": "script/cli.js" }, @@ -1664,6 +1669,25 @@ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "dev": true }, + "node_modules/detect-europe-js": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/detect-europe-js/-/detect-europe-js-0.1.2.tgz", + "integrity": "sha512-lgdERlL3u0aUdHocoouzT10d9I89VVhk0qNRmll7mXdGfJT1/wqZ2ZLA4oJAjeACPY5fT1wsbq2AT+GkuInsow==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ] + }, "node_modules/detect-libc": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", @@ -2587,6 +2611,25 @@ "node": ">=8" } }, + "node_modules/is-standalone-pwa": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-standalone-pwa/-/is-standalone-pwa-0.1.1.tgz", + "integrity": "sha512-9Cbovsa52vNQCjdXOzeQq5CnCbAcRk05aU62K20WO372NrTv0NxibLFCK6lQ4/iZEFdEA3p3t2VNOn8AJ53F5g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ] + }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -4575,6 +4618,25 @@ "node": "*" } }, + "node_modules/ua-is-frozen": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ua-is-frozen/-/ua-is-frozen-0.1.2.tgz", + "integrity": "sha512-RwKDW2p3iyWn4UbaxpP2+VxwqXh0jpvdxsYpZ5j/MLLiQOfbsV5shpgQiw93+KMYQPcteeMQ289MaAFzs3G9pw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ] + }, "node_modules/uglify-js": { "version": "3.12.8", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.8.tgz", diff --git a/package.js b/package.js deleted file mode 100644 index 0ff949d..0000000 --- a/package.js +++ /dev/null @@ -1,12 +0,0 @@ -Package.describe({ - name: 'faisalman:ua-parser-js', - 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.onUse(function (api) { - api.addFiles("src/ua-parser.js"); - api.export("UAParser"); -}); diff --git a/package.json b/package.json index 0665ddb..c307de1 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "UAParser.js PRO Personal", "name": "@ua-parser-js/pro-personal", - "version": "2.0.0-beta.3", + "version": "2.0.0-rc.3", "author": "Faisal Salman (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": [ @@ -21,7 +21,7 @@ "os-detection", "bot-detection" ], - "homepage": "https://github.com/faisalman/ua-parser-js", + "homepage": "https://uaparser.dev", "contributors": [ "Aamir Poonawalla ", "Admas ", @@ -199,7 +199,7 @@ ], "bin": "./script/cli.js", "scripts": { - "build": "./script/build-dist.sh && ./script/build-module.js", + "build": "./script/build-dist.sh && ./script/build-esm.js", "build+test": "npm run build && npm run test", "fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync", "test": "./script/test-all.sh", @@ -210,6 +210,11 @@ "test:mocha": "mocha test/mocha*js", "test:playwright": "playwright test" }, + "dependencies": { + "detect-europe-js": "^0.1.2", + "is-standalone-pwa": "^0.1.1", + "ua-is-frozen": "^0.1.2" + }, "devDependencies": { "@babel/parser": "7.15.8", "@babel/traverse": "7.23.2", @@ -226,7 +231,7 @@ "type": "git", "url": "https://github.com/faisalman/ua-parser-js.git" }, - "license": "UAParser.js-PRO-Personal", + "license": "SEE LICENSE IN LICENSE.md", "engines": { "node": "*" }, @@ -237,7 +242,7 @@ "test": "test" }, "bugs": "https://github.com/faisalman/ua-parser-js/issues", - "demo": "https://uaparser.js.org", + "demo": "https://uaparser.dev", "download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.pack.js", "funding": [ { diff --git a/script/build-module.js b/script/build-esm.js similarity index 87% rename from script/build-module.js rename to script/build-esm.js index 98fb8db..98f7ffb 100755 --- a/script/build-module.js +++ b/script/build-esm.js @@ -7,7 +7,8 @@ const generateMJS = (module) => { let text = fs.readFileSync(src, 'utf-8'); replacements.push( - [/const (.+?)\s*=\s*require\((.+)\)/ig, 'import $1 from $2'], + [/const (.+?)\s*=\s*require\(\'\.(.+)\'\)/ig, 'import $1 from \'\.$2.mjs\''], + [/const (.+?)\s*=\s*require\(\'(.+)\'\)/ig, 'import $1 from \'$2\''], [/module\.exports =/ig, 'export'] ); replacements.forEach(rep => { diff --git a/src/enums/ua-parser-enums.js b/src/enums/ua-parser-enums.js index f10d882..cf0cc8a 100644 --- a/src/enums/ua-parser-enums.js +++ b/src/enums/ua-parser-enums.js @@ -1,5 +1,5 @@ /////////////////////////////////////////////// -/* Enums for UAParser.js v2.0.0-beta.3 +/* Enums for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman UAParser.js PRO Personal License */ @@ -8,8 +8,9 @@ /*jshint esversion: 6 */ const Browser = Object.freeze({ - _2345_EXPLORER: '2345Explorer', - _360: '360 Browser', + '115': '115', + '2345': '2345', + '360': '360', ALIPAY: 'Alipay', AMAYA: 'Amaya', ANDROID: 'Android Browser', @@ -32,11 +33,11 @@ const Browser = Object.freeze({ CHROMIUM: 'Chromium', COBALT: 'Cobalt', COC_COC: 'Coc Coc', - COMODO_DRAGON: 'Comodo Dragon', CONKEROR: 'Conkeror', DILLO: 'Dillo', DOLPHIN: 'Dolphin', DORIS: 'Doris', + DRAGON: 'Dragon', DUCKDUCKGO: 'DuckDuckGo', EDGE: 'Edge', EPIPHANY: 'Epiphany', @@ -52,7 +53,9 @@ const Browser = Object.freeze({ FLOW: 'Flow', GO: 'GoBrowser', GOOGLE_SEARCH: 'GSA', + HELIO: 'Helio', HEYTAP: 'HeyTap', + HONOR: 'Honor', HUAWEI: 'Huawei Browser', ICAB: 'iCab', ICE: 'ICE Browser', @@ -73,6 +76,7 @@ const Browser = Object.freeze({ KLARNA: 'Klarna', KINDLE: 'Kindle', LENOVO: 'Smart Lenovo Browser', + LIBREWOLF: 'LibreWolf', LIEBAO: 'LBBROWSER', LINE: 'Line', LINKEDIN: 'LinkedIn', @@ -121,7 +125,9 @@ const Browser = Object.freeze({ SILK: 'Silk', SKYFIRE: 'Skyfire', SLEIPNIR: 'Sleipnir', + SLIMBOAT: 'SlimBoat', SLIMBROWSER: 'SlimBrowser', + SLIMJET: 'Slimjet', SNAPCHAT: 'Snapchat', SOGOU_EXPLORER: 'Sogou Explorer', SOGOU_MOBILE: 'Sogou Mobile', @@ -152,10 +158,12 @@ const BrowserType = Object.freeze({ EMAIL: 'email', FETCHER: 'fetcher', INAPP: 'inapp', - MODULE: 'module' + MEDIAPLAYER: 'mediaplayer', + LIBRARY: 'library' }); const CPU = Object.freeze({ + '68K': '68k', ARM : 'arm', ARM_64: 'arm64', ARM_HF: 'armhf', @@ -166,7 +174,6 @@ const CPU = Object.freeze({ IRIX_64: 'irix64', MIPS: 'mips', MIPS_64: 'mips64', - M68K: '68k', PA_RISC: 'pa-risc', PPC: 'ppc', SPARC: 'sparc', @@ -188,6 +195,7 @@ const Device = Object.freeze({ const Vendor = Object.freeze({ ACER: 'Acer', + ADVAN: 'Advan', ALCATEL: 'Alcatel', APPLE: 'Apple', AMAZON: 'Amazon', @@ -196,7 +204,9 @@ const Vendor = Object.freeze({ ATT: 'AT&T', BENQ: 'BenQ', BLACKBERRY: 'BlackBerry', + CAT: 'Cat', DELL: 'Dell', + ENERGIZER: 'Energizer', ESSENTIAL: 'Essential', FACEBOOK: 'Facebook', FAIRPHONE: 'Fairphone', @@ -206,17 +216,21 @@ const Vendor = Object.freeze({ HP: 'HP', HTC: 'HTC', HUAWEI: 'Huawei', + IMO: 'IMO', INFINIX: 'Infinix', + ITEL: 'itel', JOLLA: 'Jolla', KOBO: 'Kobo', LENOVO: 'Lenovo', LG: 'LG', MEIZU: 'Meizu', + MICROMAX: 'Micromax', MICROSOFT: 'Microsoft', MOTOROLA: 'Motorola', NEXIAN: 'Nexian', NINTENDO: 'Nintendo', NOKIA: 'Nokia', + NOTHING: 'Nothing', NVIDIA: 'Nvidia', ONEPLUS: 'OnePlus', OPPO: 'OPPO', @@ -224,6 +238,7 @@ const Vendor = Object.freeze({ PALM: 'Palm', PANASONIC: 'Panasonic', PEBBLE: 'Pebble', + PICO: 'Pico', POLYTRON: 'Polytron', REALME: 'Realme', RIM: 'RIM', @@ -231,8 +246,10 @@ const Vendor = Object.freeze({ SAMSUNG: 'Samsung', SHARP: 'Sharp', SIEMENS: 'Siemens', + SMARTFREN: 'Smartfren', SONY: 'Sony', SPRINT: 'Sprint', + TCL: 'TCL', TECHNISAT: 'TechniSAT', TECNO: 'Tecno', TESLA: 'Tesla', @@ -249,6 +266,7 @@ const Vendor = Object.freeze({ const Engine = Object.freeze({ AMAYA: 'Amaya', + ARKWEB: 'ArkWeb', BLINK: 'Blink', EDGEHTML: 'EdgeHTML', FLOW: 'Flow', @@ -262,6 +280,7 @@ const Engine = Object.freeze({ NETFRONT: 'NetFront', NETSURF: 'NetSurf', PRESTO: 'Presto', + SERVO: 'Servo', TASMAN: 'Tasman', TRIDENT: 'Trident', W3M: 'w3m', @@ -280,6 +299,10 @@ const OS = Object.freeze({ CENTOS: 'CentOS', CHROME_OS: 'Chrome OS', CHROMECAST: 'Chromecast', + CHROMECAST_ANDROID: 'Chromecast Android', + CHROMECAST_FUCHSIA: 'Chromecast Fuchsia', + CHROMECAST_LINUX: 'Chromecast Linux', + CHROMECAST_SMARTSPEAKER: 'Chromecast SmartSpeaker', CONTIKI: 'Contiki', DEBIAN: 'Debian', DEEPIN: 'Deepin', @@ -315,12 +338,14 @@ const OS = Object.freeze({ NETRANGE: 'NetRange', NETTV: 'NetTV', NINTENDO: 'Nintendo', + OPENHARMONY: 'OpenHarmony', OPENBSD: 'OpenBSD', OPENVMS: 'OpenVMS', OS2: 'OS/2', PALM: 'Palm', PC_BSD: 'PC-BSD', PCLINUXOS: 'PCLinuxOS', + PICO: 'Pico', PLAN9: 'Plan9', PLAYSTATION: 'PlayStation', QNX: 'QNX', @@ -340,7 +365,6 @@ const OS = Object.freeze({ UBUNTU: 'Ubuntu', UNIX: 'Unix', VECTORLINUX: 'VectorLinux', - VIERA: 'Viera', WATCHOS: 'watchOS', WEBOS: 'WebOS', WINDOWS: 'Windows', diff --git a/src/enums/ua-parser-enums.mjs b/src/enums/ua-parser-enums.mjs index 9c18886..1bdaca8 100644 --- a/src/enums/ua-parser-enums.mjs +++ b/src/enums/ua-parser-enums.mjs @@ -3,7 +3,7 @@ // Source: /src/enums/ua-parser-enums.js /////////////////////////////////////////////// -/* Enums for UAParser.js v2.0.0-beta.3 +/* Enums for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman UAParser.js PRO Personal License */ @@ -12,8 +12,9 @@ /*jshint esversion: 6 */ const Browser = Object.freeze({ - _2345_EXPLORER: '2345Explorer', - _360: '360 Browser', + '115': '115', + '2345': '2345', + '360': '360', ALIPAY: 'Alipay', AMAYA: 'Amaya', ANDROID: 'Android Browser', @@ -36,11 +37,11 @@ const Browser = Object.freeze({ CHROMIUM: 'Chromium', COBALT: 'Cobalt', COC_COC: 'Coc Coc', - COMODO_DRAGON: 'Comodo Dragon', CONKEROR: 'Conkeror', DILLO: 'Dillo', DOLPHIN: 'Dolphin', DORIS: 'Doris', + DRAGON: 'Dragon', DUCKDUCKGO: 'DuckDuckGo', EDGE: 'Edge', EPIPHANY: 'Epiphany', @@ -56,7 +57,9 @@ const Browser = Object.freeze({ FLOW: 'Flow', GO: 'GoBrowser', GOOGLE_SEARCH: 'GSA', + HELIO: 'Helio', HEYTAP: 'HeyTap', + HONOR: 'Honor', HUAWEI: 'Huawei Browser', ICAB: 'iCab', ICE: 'ICE Browser', @@ -77,6 +80,7 @@ const Browser = Object.freeze({ KLARNA: 'Klarna', KINDLE: 'Kindle', LENOVO: 'Smart Lenovo Browser', + LIBREWOLF: 'LibreWolf', LIEBAO: 'LBBROWSER', LINE: 'Line', LINKEDIN: 'LinkedIn', @@ -125,7 +129,9 @@ const Browser = Object.freeze({ SILK: 'Silk', SKYFIRE: 'Skyfire', SLEIPNIR: 'Sleipnir', + SLIMBOAT: 'SlimBoat', SLIMBROWSER: 'SlimBrowser', + SLIMJET: 'Slimjet', SNAPCHAT: 'Snapchat', SOGOU_EXPLORER: 'Sogou Explorer', SOGOU_MOBILE: 'Sogou Mobile', @@ -156,10 +162,12 @@ const BrowserType = Object.freeze({ EMAIL: 'email', FETCHER: 'fetcher', INAPP: 'inapp', - MODULE: 'module' + MEDIAPLAYER: 'mediaplayer', + LIBRARY: 'library' }); const CPU = Object.freeze({ + '68K': '68k', ARM : 'arm', ARM_64: 'arm64', ARM_HF: 'armhf', @@ -170,7 +178,6 @@ const CPU = Object.freeze({ IRIX_64: 'irix64', MIPS: 'mips', MIPS_64: 'mips64', - M68K: '68k', PA_RISC: 'pa-risc', PPC: 'ppc', SPARC: 'sparc', @@ -192,6 +199,7 @@ const Device = Object.freeze({ const Vendor = Object.freeze({ ACER: 'Acer', + ADVAN: 'Advan', ALCATEL: 'Alcatel', APPLE: 'Apple', AMAZON: 'Amazon', @@ -200,7 +208,9 @@ const Vendor = Object.freeze({ ATT: 'AT&T', BENQ: 'BenQ', BLACKBERRY: 'BlackBerry', + CAT: 'Cat', DELL: 'Dell', + ENERGIZER: 'Energizer', ESSENTIAL: 'Essential', FACEBOOK: 'Facebook', FAIRPHONE: 'Fairphone', @@ -210,17 +220,21 @@ const Vendor = Object.freeze({ HP: 'HP', HTC: 'HTC', HUAWEI: 'Huawei', + IMO: 'IMO', INFINIX: 'Infinix', + ITEL: 'itel', JOLLA: 'Jolla', KOBO: 'Kobo', LENOVO: 'Lenovo', LG: 'LG', MEIZU: 'Meizu', + MICROMAX: 'Micromax', MICROSOFT: 'Microsoft', MOTOROLA: 'Motorola', NEXIAN: 'Nexian', NINTENDO: 'Nintendo', NOKIA: 'Nokia', + NOTHING: 'Nothing', NVIDIA: 'Nvidia', ONEPLUS: 'OnePlus', OPPO: 'OPPO', @@ -228,6 +242,7 @@ const Vendor = Object.freeze({ PALM: 'Palm', PANASONIC: 'Panasonic', PEBBLE: 'Pebble', + PICO: 'Pico', POLYTRON: 'Polytron', REALME: 'Realme', RIM: 'RIM', @@ -235,8 +250,10 @@ const Vendor = Object.freeze({ SAMSUNG: 'Samsung', SHARP: 'Sharp', SIEMENS: 'Siemens', + SMARTFREN: 'Smartfren', SONY: 'Sony', SPRINT: 'Sprint', + TCL: 'TCL', TECHNISAT: 'TechniSAT', TECNO: 'Tecno', TESLA: 'Tesla', @@ -253,6 +270,7 @@ const Vendor = Object.freeze({ const Engine = Object.freeze({ AMAYA: 'Amaya', + ARKWEB: 'ArkWeb', BLINK: 'Blink', EDGEHTML: 'EdgeHTML', FLOW: 'Flow', @@ -266,6 +284,7 @@ const Engine = Object.freeze({ NETFRONT: 'NetFront', NETSURF: 'NetSurf', PRESTO: 'Presto', + SERVO: 'Servo', TASMAN: 'Tasman', TRIDENT: 'Trident', W3M: 'w3m', @@ -284,6 +303,10 @@ const OS = Object.freeze({ CENTOS: 'CentOS', CHROME_OS: 'Chrome OS', CHROMECAST: 'Chromecast', + CHROMECAST_ANDROID: 'Chromecast Android', + CHROMECAST_FUCHSIA: 'Chromecast Fuchsia', + CHROMECAST_LINUX: 'Chromecast Linux', + CHROMECAST_SMARTSPEAKER: 'Chromecast SmartSpeaker', CONTIKI: 'Contiki', DEBIAN: 'Debian', DEEPIN: 'Deepin', @@ -319,12 +342,14 @@ const OS = Object.freeze({ NETRANGE: 'NetRange', NETTV: 'NetTV', NINTENDO: 'Nintendo', + OPENHARMONY: 'OpenHarmony', OPENBSD: 'OpenBSD', OPENVMS: 'OpenVMS', OS2: 'OS/2', PALM: 'Palm', PC_BSD: 'PC-BSD', PCLINUXOS: 'PCLinuxOS', + PICO: 'Pico', PLAN9: 'Plan9', PLAYSTATION: 'PlayStation', QNX: 'QNX', @@ -344,7 +369,6 @@ const OS = Object.freeze({ UBUNTU: 'Ubuntu', UNIX: 'Unix', VECTORLINUX: 'VectorLinux', - VIERA: 'Viera', WATCHOS: 'watchOS', WEBOS: 'WebOS', WINDOWS: 'Windows', diff --git a/src/extensions/ua-parser-extensions.d.ts b/src/extensions/ua-parser-extensions.d.ts index 5d6f300..b4da549 100644 --- a/src/extensions/ua-parser-extensions.d.ts +++ b/src/extensions/ua-parser-extensions.d.ts @@ -1,14 +1,15 @@ -// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3 +// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3 // Project: https://github.com/faisalman/ua-parser-js // Definitions by: Faisal Salman import type { UAParserExt } from "../main/ua-parser"; +export const Bots: UAParserExt; 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; \ No newline at end of file +export const Libraries: UAParserExt; +export const MediaPlayers: UAParserExt; \ No newline at end of file diff --git a/src/extensions/ua-parser-extensions.js b/src/extensions/ua-parser-extensions.js index 0ba1bf3..b171def 100644 --- a/src/extensions/ua-parser-extensions.js +++ b/src/extensions/ua-parser-extensions.js @@ -1,5 +1,5 @@ /////////////////////////////////////////////// -/* Extensions for UAParser.js v2.0.0-beta.3 +/* Extensions for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman UAParser.js PRO Personal License */ @@ -19,7 +19,8 @@ const CLI = 'cli'; const EMAIL = 'email'; const FETCHER = 'fetcher'; const INAPP = 'inapp'; -const MODULE = 'module'; +const MEDIAPLAYER = 'mediaplayer'; +const LIBRARY = 'library'; ////////////////////// // COMMAND LINE APPS @@ -38,43 +39,73 @@ const CLIs = Object.freeze({ 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], + // AhrefsBot - https://ahrefs.com/robot + // Amazonbot - https://developer.amazon.com/amazonbot + // Applebot - http://apple.com/go/applebot + // Bingbot - http://www.bing.com/bingbot.htm + // CCBot - https://commoncrawl.org/faq + // Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot + // DuckDuckBot - http://duckduckgo.com/duckduckbot.html + // FacebookBot - https://developers.facebook.com/docs/sharing/bot/ + // GPTBot - https://platform.openai.com/docs/gptbot + // MJ12bot - https://mj12bot.com/ + // MojeekBot - https://www.mojeek.com/bot.html + // OpenAI's SearchGPT - https://platform.openai.com/docs/bots + // PerplexityBot - https://perplexity.ai/perplexitybot + // SemrushBot - http://www.semrush.com/bot.html + /((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i, + + // Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001 + /(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i, + + // ClaudeBot (Anthropic) + /(claude(?:bot|-web))\/([\w\.]+)/i, + + // Coc Coc Bot - https://help.coccoc.com/en/search-engine + /(coccocbot-(?:image|web))\/([\w\.]+)/i, + + // Facebook / Meta + // https://developers.facebook.com/docs/sharing/webmasters/web-crawlers + /(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i, + + // Googlebot - http://www.google.com/bot.html + /(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i, + + // Internet Archive (archive.org) + /(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i, + + // Sogou Spider + /(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i, + + // Yahoo! Japan - https://support.yahoo-net.jp/PccSearch/s/article/H000007955 + /(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i, + + // 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, + + // Yeti (Naver) + /(yeti)\/([\w\.]+)/i, + + // YisouSpider + /(yisouspider)\/?([\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 + // Google Bots + /((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i, + + // Bytespider + // DataForSeoBot - https://dataforseo.com/dataforseo-bot + // Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot + // Qihoo 360Spider + // TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html + // Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp + /(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i ], - [NAME, VERSION, [TYPE, CRAWLER]] + [NAME, [TYPE, CRAWLER]] ] }); @@ -164,8 +195,8 @@ const ExtraDevices = Object.freeze({ const Emails = Object.freeze({ browser : [ - // Microsoft Outlook / Thunderbird - [/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]] + // Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird + [/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]] ] }); @@ -175,29 +206,37 @@ const Emails = Object.freeze({ 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 [ + // AhrefsSiteAudit - https://ahrefs.com/robot/site-audit + // ChatGPT-User - https://platform.openai.com/docs/plugins/bot + // DuckAssistBot - https://duckduckgo.com/duckassistbot/ + // BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / Telegrambot / Twitterbot / UptimeRobot + /(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i, + + // Google Site Verifier + /(google-site-verification)\/([\w\.]+)/i, + + // Meta + /(meta-externalfetcher)\/([\w\.]+)/i, + + // Slackbot - https://api.slack.com/robots + /(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i, + + // WhatsApp + /(whatsapp)\/([\w\.]+)[\/ ][ianw]/i, + + // Yahoo! Japan + /(y!?j-dlc)\/([\w\.]+)/i, + + // Yandex Bots - https://yandex.com/bots /(yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i, /(yandex(?:sitelinks|userproxy))/i ], - [NAME, VERSION, [TYPE, FETCHER]] + [NAME, VERSION, [TYPE, FETCHER]], + + // Google Bots / Snapchat + [/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i], + [NAME, [TYPE, FETCHER]], ] }); @@ -207,7 +246,11 @@ const Fetchers = Object.freeze({ const InApps = Object.freeze({ browser : [ - [/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]] + // Slack + [/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]], + + // Yahoo! Japan + [/jp\.co\.yahoo\.android\.yjtop\/([\d\.]+)/i], [VERSION, 'Yahoo! Japan', [TYPE, INAPP]] ] }); @@ -220,13 +263,13 @@ const MediaPlayers = Object.freeze({ /(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia /(coremedia) v([\w\._]+)/i - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i, // Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC @@ -234,111 +277,125 @@ const MediaPlayers = Object.freeze({ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(nexplayer)\s([\w\.-]+)/i // Nexplayer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(flrp)\/([\w\.-]+)/i // Flip Player - ], [[NAME, 'Flip Player'], VERSION], [ + ], [[NAME, 'Flip Player'], VERSION, [TYPE, MEDIAPLAYER]], [ - /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i - // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit - ], [NAME], [ + /(fstream|nativehost|queryseekspider)/i + // FStream/NativeHost/QuerySeekSpider + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i // Gstreamer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(htc_one_s)\/([\d\.]+)/i, // HTC One S - ], [[NAME, /_/g, ' '], VERSION], [ + ], [[NAME, /_/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i, // MPlayer SVN - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer /(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)/i, // MPlayer (no other info) /(yourmuze)/i, // YourMuze /(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime - ], [NAME], [ + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(nokia\d+)\/([\w\.-]+)/i // Nokia - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(winamp)3 version ([\w\.-]+)/i, // Winamp /(winamp)\s([\w\.-]+)/i, /(winamp)mpeg\/([\w\.-]+)/i - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info) // inlight radio - ], [NAME], [ + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i // QuickTime/RealMedia/RadioApp/RadioClientApplication/ // SoundTap/Totem/Stagefright/Streamium - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(smp)([\d\.]+)/i // SMP - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(wmplayer)\/([\w\.-]+)/i, // Windows Media Player /(windows-media-player)\/([\w\.-]+)/i - ], [[NAME, /-/g, ' '], VERSION], [ + ], [[NAME, /-/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [ /windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i, // Windows Media Server - ], [VERSION, [NAME, 'Windows']], [ + ], [VERSION, [NAME, 'Windows'], [TYPE, MEDIAPLAYER]], [ /(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(rad.io)\s([\d\.]+)/i, // Rad.io /(radio.(?:de|at|fr))\s([\d\.]+)/i - ], [[NAME, 'rad.io'], VERSION] + ], [[NAME, 'rad.io'], VERSION, [TYPE, MEDIAPLAYER]] ] }); -//////////////////////// -// MODULES / LIBRARIES -/////////////////////// +///////////// +// LIBRARIES +////////////// -const Modules = Object.freeze({ +const Libraries = Object.freeze({ browser : [ // Axios/jsdom/Scrapy - [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]] + [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]] + ] +}); + +////////// +// BOTS +///////// + +const Bots = Object.freeze({ + browser : [ + ...CLIs.browser, + ...Crawlers.browser, + ...Fetchers.browser, + ...Libraries.browser ] }); module.exports = { + Bots, CLIs, Crawlers, ExtraDevices, Emails, Fetchers, InApps, - MediaPlayers, - Modules + Libraries, + MediaPlayers }; \ No newline at end of file diff --git a/src/extensions/ua-parser-extensions.mjs b/src/extensions/ua-parser-extensions.mjs index 572a55d..0d4bbcd 100644 --- a/src/extensions/ua-parser-extensions.mjs +++ b/src/extensions/ua-parser-extensions.mjs @@ -3,7 +3,7 @@ // Source: /src/extensions/ua-parser-extensions.js /////////////////////////////////////////////// -/* Extensions for UAParser.js v2.0.0-beta.3 +/* Extensions for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman UAParser.js PRO Personal License */ @@ -23,7 +23,8 @@ const CLI = 'cli'; const EMAIL = 'email'; const FETCHER = 'fetcher'; const INAPP = 'inapp'; -const MODULE = 'module'; +const MEDIAPLAYER = 'mediaplayer'; +const LIBRARY = 'library'; ////////////////////// // COMMAND LINE APPS @@ -42,43 +43,73 @@ const CLIs = Object.freeze({ 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], + // AhrefsBot - https://ahrefs.com/robot + // Amazonbot - https://developer.amazon.com/amazonbot + // Applebot - http://apple.com/go/applebot + // Bingbot - http://www.bing.com/bingbot.htm + // CCBot - https://commoncrawl.org/faq + // Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot + // DuckDuckBot - http://duckduckgo.com/duckduckbot.html + // FacebookBot - https://developers.facebook.com/docs/sharing/bot/ + // GPTBot - https://platform.openai.com/docs/gptbot + // MJ12bot - https://mj12bot.com/ + // MojeekBot - https://www.mojeek.com/bot.html + // OpenAI's SearchGPT - https://platform.openai.com/docs/bots + // PerplexityBot - https://perplexity.ai/perplexitybot + // SemrushBot - http://www.semrush.com/bot.html + /((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i, + + // Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001 + /(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i, + + // ClaudeBot (Anthropic) + /(claude(?:bot|-web))\/([\w\.]+)/i, + + // Coc Coc Bot - https://help.coccoc.com/en/search-engine + /(coccocbot-(?:image|web))\/([\w\.]+)/i, + + // Facebook / Meta + // https://developers.facebook.com/docs/sharing/webmasters/web-crawlers + /(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i, + + // Googlebot - http://www.google.com/bot.html + /(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i, + + // Internet Archive (archive.org) + /(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i, + + // Sogou Spider + /(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i, + + // Yahoo! Japan - https://support.yahoo-net.jp/PccSearch/s/article/H000007955 + /(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i, + + // 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, + + // Yeti (Naver) + /(yeti)\/([\w\.]+)/i, + + // YisouSpider + /(yisouspider)\/?([\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 + // Google Bots + /((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i, + + // Bytespider + // DataForSeoBot - https://dataforseo.com/dataforseo-bot + // Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot + // Qihoo 360Spider + // TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html + // Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp + /(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i ], - [NAME, VERSION, [TYPE, CRAWLER]] + [NAME, [TYPE, CRAWLER]] ] }); @@ -168,8 +199,8 @@ const ExtraDevices = Object.freeze({ const Emails = Object.freeze({ browser : [ - // Microsoft Outlook / Thunderbird - [/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]] + // Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird + [/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]] ] }); @@ -179,29 +210,37 @@ const Emails = Object.freeze({ 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 [ + // AhrefsSiteAudit - https://ahrefs.com/robot/site-audit + // ChatGPT-User - https://platform.openai.com/docs/plugins/bot + // DuckAssistBot - https://duckduckgo.com/duckassistbot/ + // BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / Telegrambot / Twitterbot / UptimeRobot + /(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i, + + // Google Site Verifier + /(google-site-verification)\/([\w\.]+)/i, + + // Meta + /(meta-externalfetcher)\/([\w\.]+)/i, + + // Slackbot - https://api.slack.com/robots + /(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i, + + // WhatsApp + /(whatsapp)\/([\w\.]+)[\/ ][ianw]/i, + + // Yahoo! Japan + /(y!?j-dlc)\/([\w\.]+)/i, + + // Yandex Bots - https://yandex.com/bots /(yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i, /(yandex(?:sitelinks|userproxy))/i ], - [NAME, VERSION, [TYPE, FETCHER]] + [NAME, VERSION, [TYPE, FETCHER]], + + // Google Bots / Snapchat + [/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i], + [NAME, [TYPE, FETCHER]], ] }); @@ -211,7 +250,11 @@ const Fetchers = Object.freeze({ const InApps = Object.freeze({ browser : [ - [/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]] + // Slack + [/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, INAPP]], + + // Yahoo! Japan + [/jp\.co\.yahoo\.android\.yjtop\/([\d\.]+)/i], [VERSION, 'Yahoo! Japan', [TYPE, INAPP]] ] }); @@ -224,13 +267,13 @@ const MediaPlayers = Object.freeze({ /(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia /(coremedia) v([\w\._]+)/i - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i, // Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC @@ -238,111 +281,125 @@ const MediaPlayers = Object.freeze({ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(nexplayer)\s([\w\.-]+)/i // Nexplayer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(flrp)\/([\w\.-]+)/i // Flip Player - ], [[NAME, 'Flip Player'], VERSION], [ + ], [[NAME, 'Flip Player'], VERSION, [TYPE, MEDIAPLAYER]], [ - /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i - // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit - ], [NAME], [ + /(fstream|nativehost|queryseekspider)/i + // FStream/NativeHost/QuerySeekSpider + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i // Gstreamer - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(htc_one_s)\/([\d\.]+)/i, // HTC One S - ], [[NAME, /_/g, ' '], VERSION], [ + ], [[NAME, /_/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i, // MPlayer SVN - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer /(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(mplayer)/i, // MPlayer (no other info) /(yourmuze)/i, // YourMuze /(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime - ], [NAME], [ + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(nokia\d+)\/([\w\.-]+)/i // Nokia - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(winamp)3 version ([\w\.-]+)/i, // Winamp /(winamp)\s([\w\.-]+)/i, /(winamp)mpeg\/([\w\.-]+)/i - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info) // inlight radio - ], [NAME], [ + ], [NAME, [TYPE, MEDIAPLAYER]], [ /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i // QuickTime/RealMedia/RadioApp/RadioClientApplication/ // SoundTap/Totem/Stagefright/Streamium - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(smp)([\d\.]+)/i // SMP - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(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], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(wmplayer)\/([\w\.-]+)/i, // Windows Media Player /(windows-media-player)\/([\w\.-]+)/i - ], [[NAME, /-/g, ' '], VERSION], [ + ], [[NAME, /-/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [ /windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i, // Windows Media Server - ], [VERSION, [NAME, 'Windows']], [ + ], [VERSION, [NAME, 'Windows'], [TYPE, MEDIAPLAYER]], [ /(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm - ], [NAME, VERSION], [ + ], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [ /(rad.io)\s([\d\.]+)/i, // Rad.io /(radio.(?:de|at|fr))\s([\d\.]+)/i - ], [[NAME, 'rad.io'], VERSION] + ], [[NAME, 'rad.io'], VERSION, [TYPE, MEDIAPLAYER]] ] }); -//////////////////////// -// MODULES / LIBRARIES -/////////////////////// +///////////// +// LIBRARIES +////////////// -const Modules = Object.freeze({ +const Libraries = Object.freeze({ browser : [ // Axios/jsdom/Scrapy - [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]] + [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]] + ] +}); + +////////// +// BOTS +///////// + +const Bots = Object.freeze({ + browser : [ + ...CLIs.browser, + ...Crawlers.browser, + ...Fetchers.browser, + ...Libraries.browser ] }); export { + Bots, CLIs, Crawlers, ExtraDevices, Emails, Fetchers, InApps, - MediaPlayers, - Modules + Libraries, + MediaPlayers }; \ No newline at end of file diff --git a/src/helpers/ua-parser-helpers.d.ts b/src/helpers/ua-parser-helpers.d.ts index 89f64f0..10398d6 100644 --- a/src/helpers/ua-parser-helpers.d.ts +++ b/src/helpers/ua-parser-helpers.d.ts @@ -1,15 +1,25 @@ -// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3 +// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3 // Project: https://github.com/faisalman/ua-parser-js // Definitions by: Faisal Salman import { IResult } from "../main/ua-parser"; -declare function isAppleSilicon(res: IResult): boolean; -declare function isChromiumBased(res: IResult): boolean; +declare function getDeviceVendor(model: string): string | undefined; +declare function isAppleSilicon(res: IResult, useFeatureDetection?: boolean): boolean; +declare function isBot(res: IResult): boolean; +declare function isChromeFamily(res: IResult): boolean; +declare function isElectron(): boolean; +declare function isFromEU(): boolean; declare function isFrozenUA(ua: string): boolean; +declare function isStandalonePWA(): boolean; export { + getDeviceVendor, isAppleSilicon, - isChromiumBased, - isFrozenUA + isBot, + isChromeFamily, + isElectron, + isFromEU, + isFrozenUA, + isStandalonePWA } \ No newline at end of file diff --git a/src/helpers/ua-parser-helpers.js b/src/helpers/ua-parser-helpers.js index 4cbf30e..bf3fab7 100644 --- a/src/helpers/ua-parser-helpers.js +++ b/src/helpers/ua-parser-helpers.js @@ -1,22 +1,56 @@ /////////////////////////////////////////////// -/* Helpers for UAParser.js v2.0.0-beta.3 +/* Helpers for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - AGPLv3 License */ + UAParser.js PRO Personal License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ +const { UAParser } = require('../main/ua-parser'); const { CPU, OS, Engine } = require('../enums/ua-parser-enums'); +const { isFromEU } = require('detect-europe-js'); +const { isFrozenUA } = require('ua-is-frozen'); +const { isStandalonePWA } = require('is-standalone-pwa'); -const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM); +const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor; -const isChromiumBased = (res) => res.engine.is(Engine.BLINK); +const isAppleSilicon = (res, useFeatureDetection) => { + if (res.os.is(OS.MACOS)) { + if (res.cpu.is(CPU.ARM)) { + return true; + } + if (useFeatureDetection) { + try { + const canvas = document.createElement('canvas'); + const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + const debug = webgl.getExtension('WEBGL_debug_renderer_info'); + const renderer = webgl.getParameter(debug.UNMASKED_RENDERER_WEBGL); + if (renderer.match(/apple m\d/i)) { + return true; + } + } catch { + return false; + } + } + } + return false; +} -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); +const isBot = (res) => ['cli', 'crawler', 'fetcher', 'library'].includes(res.browser.type); + +const isChromeFamily = (res) => res.engine.is(Engine.BLINK); + +const isElectron = () => !!(process?.versions?.hasOwnProperty('electron') || // node.js + / electron\//i.test(navigator?.userAgent)); // browser module.exports = { + getDeviceVendor, isAppleSilicon, - isChromiumBased, - isFrozenUA + isBot, + isChromeFamily, + isElectron, + isFromEU, + isFrozenUA, + isStandalonePWA } \ No newline at end of file diff --git a/src/helpers/ua-parser-helpers.mjs b/src/helpers/ua-parser-helpers.mjs index cc3533d..784f1a3 100644 --- a/src/helpers/ua-parser-helpers.mjs +++ b/src/helpers/ua-parser-helpers.mjs @@ -3,24 +3,58 @@ // Source: /src/helpers/ua-parser-helpers.js /////////////////////////////////////////////// -/* Helpers for UAParser.js v2.0.0-beta.3 +/* Helpers for UAParser.js v2.0.0-rc.3 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - AGPLv3 License */ + UAParser.js PRO Personal License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ -import { CPU, OS, Engine } from '../enums/ua-parser-enums'; +import { UAParser } from '../main/ua-parser.mjs'; +import { CPU, OS, Engine } from '../enums/ua-parser-enums.mjs'; +import { isFromEU } from 'detect-europe-js'; +import { isFrozenUA } from 'ua-is-frozen'; +import { isStandalonePWA } from 'is-standalone-pwa'; -const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM); +const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor; -const isChromiumBased = (res) => res.engine.is(Engine.BLINK); +const isAppleSilicon = (res, useFeatureDetection) => { + if (res.os.is(OS.MACOS)) { + if (res.cpu.is(CPU.ARM)) { + return true; + } + if (useFeatureDetection) { + try { + const canvas = document.createElement('canvas'); + const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + const debug = webgl.getExtension('WEBGL_debug_renderer_info'); + const renderer = webgl.getParameter(debug.UNMASKED_RENDERER_WEBGL); + if (renderer.match(/apple m\d/i)) { + return true; + } + } catch { + return false; + } + } + } + return false; +} -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); +const isBot = (res) => ['cli', 'crawler', 'fetcher', 'library'].includes(res.browser.type); + +const isChromeFamily = (res) => res.engine.is(Engine.BLINK); + +const isElectron = () => !!(process?.versions?.hasOwnProperty('electron') || // node.js + / electron\//i.test(navigator?.userAgent)); // browser export { + getDeviceVendor, isAppleSilicon, - isChromiumBased, - isFrozenUA + isBot, + isChromeFamily, + isElectron, + isFromEU, + isFrozenUA, + isStandalonePWA } \ No newline at end of file diff --git a/src/main/ua-parser.d.ts b/src/main/ua-parser.d.ts index 2fa75c7..4e64bf4 100644 --- a/src/main/ua-parser.d.ts +++ b/src/main/ua-parser.d.ts @@ -1,4 +1,4 @@ -// Type definitions for UAParser.js v2.0.0-beta.3 +// Type definitions for UAParser.js v2.0.0-rc.3 // Project: https://github.com/faisalman/ua-parser-js // Definitions by: Faisal Salman @@ -8,18 +8,18 @@ declare namespace UAParser { is(val: string): boolean; toString(): string; withClientHints(): PromiseLike | T; - withFeatureCheck(): T; + withFeatureCheck(): PromiseLike | T; } interface IBrowser extends IData { name?: string; version?: string; major?: string; - type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module'; + type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'library'; } interface ICPU extends IData { - architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'ppc' | 'sparc' | 'sparc64'; + architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'avr32' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'pa-risc' | 'ppc' | 'sparc' | 'sparc64'; } interface IDevice extends IData { @@ -29,7 +29,7 @@ declare namespace UAParser { } interface IEngine extends IData { - name?: 'Amaya' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit'; + name?: 'Amaya' | 'ArkWeb' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Servo' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit'; version?: string; } diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index 589d5a4..8a9251e 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////////// -/* UAParser.js v2.0.0-beta.3 +/* UAParser.js v2.0.0-rc.3 Copyright © 2012-2024 Faisal Salman UAParser.js PRO Personal License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. @@ -19,7 +19,7 @@ // Constants ///////////// - var LIBVERSION = '2.0.0-beta.3', + var LIBVERSION = '2.0.0-rc.3', EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', @@ -40,6 +40,7 @@ WEARABLE = 'wearable', XR = 'xr', EMBEDDED = 'embedded', + INAPP = 'inapp', USER_AGENT = 'user-agent', UA_MAX_LENGTH = 500, BRANDS = 'brands', @@ -71,6 +72,7 @@ GOOGLE = 'Google', HUAWEI = 'Huawei', LENOVO = 'Lenovo', + HONOR = 'Honor', LG = 'LG', MICROSOFT = 'Microsoft', MOTOROLA = 'Motorola', @@ -82,6 +84,7 @@ PREFIX_MOBILE = 'Mobile ', SUFFIX_BROWSER = ' Browser', CHROME = 'Chrome', + CHROMECAST = 'Chromecast', EDGE = 'Edge', FIREFOX = 'Firefox', OPERA = 'Opera', @@ -319,19 +322,23 @@ // Mixed /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu ], [VERSION, [NAME, 'Baidu']], [ + /\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i // Maxthon + ], [VERSION, [NAME, 'Maxthon']], [ /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir // Trident based - /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser + /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, // Avant/IEMobile/SlimBrowser/SlimBoat/Slimjet /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer - // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon - /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar)\/([-\w\.]+)/i, - // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar - /(heytap|ovi)browser\/([\d\.]+)/i, // HeyTap/Ovi + // Blink/Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon + /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i, + // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio/Dragon + /(heytap|ovi|115)browser\/([\d\.]+)/i, // HeyTap/Ovi/115 /(weibo)__([\d\.]+)/i // Weibo ], [NAME, VERSION], [ + /quark(?:pc)?\/([-\w\.]+)/i // Quark + ], [VERSION, [NAME, 'Quark']], [ /\bddg\/([\w\.]+)/i // DuckDuckGo ], [VERSION, [NAME, 'DuckDuckGo']], [ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser @@ -364,31 +371,31 @@ ], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [ /fxios\/([\w\.-]+)/i // Firefox for iOS ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [ - /\bqihu|(qi?ho?o?|360)browser/i // 360 - ], [[NAME, '360' + SUFFIX_BROWSER]], [ + /\bqihoobrowser\/?([\w\.]*)/i // 360 + ], [VERSION, [NAME, '360']], [ /\b(qq)\/([\w\.]+)/i // QQ ], [[NAME, /(.+)/, '$1Browser'], VERSION], [ /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser /samsungbrowser\/([\w\.]+)/i // Samsung Internet ], [VERSION, [NAME, SAMSUNG + ' Internet']], [ - /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon - ], [[NAME, /_/g, ' '], VERSION], [ /metasr[\/ ]?([\d\.]+)/i // Sogou Explorer ], [VERSION, [NAME, SOGOU + ' Explorer']], [ /(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile ], [[NAME, SOGOU + ' Mobile'], VERSION], [ /(electron)\/([\w\.]+) safari/i, // Electron-based App /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla - /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser + /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i // QQ/2345 ], [NAME, VERSION], [ - /(lbbrowser|rekonq)/i, // LieBao Browser/Rekonq - /\[(linkedin)app\]/i // LinkedIn App for iOS & Android + /(lbbrowser|rekonq)/i // LieBao Browser/Rekonq ], [NAME], [ + /ome\/([\w\.]+) \w* ?(iron) saf/i, // Iron + /ome\/([\w\.]+).+qihu (360)[es]e/i // 360 + ], [VERSION, NAME], [ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android - ], [[NAME, FACEBOOK], VERSION], [ + ], [[NAME, FACEBOOK], VERSION, [TYPE, INAPP]], [ /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp @@ -396,12 +403,17 @@ /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /(alipay)client\/([\w\.]+)/i, // Alipay /(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter - /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat - ], [NAME, VERSION], [ + /(instagram|snapchat)[\/ ]([-\w\.]+)/i // Instagram/Snapchat + ], [NAME, VERSION, [TYPE, INAPP]], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS - ], [VERSION, [NAME, 'GSA']], [ + ], [VERSION, [NAME, 'GSA'], [TYPE, INAPP]], [ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok - ], [VERSION, [NAME, 'TikTok']], [ + ], [VERSION, [NAME, 'TikTok'], [TYPE, INAPP]], [ + /\[(linkedin)app\]/i // LinkedIn App for iOS & Android + ], [NAME, [TYPE, INAPP]], [ + + /(chromium)[\/ ]([-\w\.]+)/i // Chromium + ], [NAME, VERSION], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [VERSION, [NAME, CHROME+' Headless']], [ @@ -435,7 +447,7 @@ ], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [ /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ - /(wolvic)\/([\w\.]+)/i // Wolvic + /(wolvic|librewolf)\/([\w\.]+)/i // Wolvic/LibreWolf ], [NAME, VERSION], [ /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality ], [VERSION, [NAME, FIREFOX+' Reality']], [ @@ -497,8 +509,8 @@ // Samsung /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [ - /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, - /samsung[- ]([-\w]+)/i, + /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, + /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [ @@ -516,10 +528,14 @@ /\b(sh-?[altvz]?\d\d[a-ekm]?)/i ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [ + // Honor + /(?:honor)([-\w ]+)[;\)]/i + ], [MODEL, [VENDOR, HONOR], [TYPE, MOBILE]], [ + // Huawei /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [ - /(?:huawei|honor)([-\w ]+)[;\)]/i, + /(?:huawei)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [ @@ -529,7 +545,7 @@ /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models - /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi + /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i // Xiaomi Mi ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets @@ -584,7 +600,7 @@ ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ // Sony - /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i + /droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [ /sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i @@ -597,7 +613,7 @@ // Amazon /(alexa)webm/i, - /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show + /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, // Kindle Fire without Silk / Echo Show /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone @@ -626,6 +642,17 @@ /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ + // TCL + /tcl (xess p17aa)/i, + /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i + ], [MODEL, [VENDOR, 'TCL'], [TYPE, TABLET]], [ + /droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i + ], [MODEL, [VENDOR, 'TCL'], [TYPE, MOBILE]], [ + + // itel + /(itel) ((\w+))/i + ], [[VENDOR, lowerize], MODEL, [TYPE, strMapper, { 'tablet' : ['p10001l', 'w7001'], '*' : 'mobile' }]], [ + // Acer /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ @@ -639,9 +666,28 @@ /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i ], [MODEL, [VENDOR, 'Ulefone'], [TYPE, MOBILE]], [ + // Energizer + /; (energy ?\w+)(?: bui|\))/i, + /; energizer ([\w ]+)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Energizer'], [TYPE, MOBILE]], [ + + // Cat + /; cat (b35);/i, + /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Cat'], [TYPE, MOBILE]], [ + + // Smartfren + /((?:new )?andromax[\w- ]+)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Smartfren'], [TYPE, MOBILE]], [ + + // Nothing + /droid.+; (a(?:015|06[35]|142p?))/i + ], [MODEL, [VENDOR, 'Nothing'], [TYPE, MOBILE]], [ + // MIXED - /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, - // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i, + // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan + /; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i, // IMO /(hp) ([\w ]+\w)/i, // HP iPAQ /(asus)-?(\w+)/i, // Asus /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia @@ -650,6 +696,7 @@ /(oppo) ?([\w ]+) bui/i // OPPO ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(imo) (tab \w+)/i, // IMO /(kobo)\s(ereader|touch)/i, // Kobo /(archos) (gamepad2?)/i, // Archos /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad @@ -683,8 +730,14 @@ ], [[VENDOR, LG], [TYPE, SMARTTV]], [ /(apple) ?tv/i // Apple TV ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [ - /crkey/i // Google Chromecast - ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey.*devicetype\/chromecast/i // Google Chromecast Third Generation + ], [[MODEL, CHROMECAST+' Third Generation'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey.*devicetype\/([^/]*)/i // Google Chromecast with specific device type + ], [[MODEL, /^/, 'Chromecast '], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /fuchsia.*crkey/i // Google Chromecast Nest Hub + ], [[MODEL, CHROMECAST+' Nest Hub'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey/i // Google Chromecast, Linux-based or unknown + ], [[MODEL, CHROMECAST], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ /droid.+aft(\w+)( bui|\))/i // Fire TV ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [ /\(dtv[\);].+(aquos)/i, @@ -720,6 +773,8 @@ // WEARABLES /////////////////// + /\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i // Samsung Galaxy Watch + ], [MODEL, [VENDOR, SAMSUNG], [TYPE, WEARABLE]], [ /((pebble))app/i // Pebble ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch @@ -733,7 +788,9 @@ /droid.+; (glass) \d/i // Google Glass ], [MODEL, [VENDOR, GOOGLE], [TYPE, XR]], [ - /(quest( \d| pro)?)/i // Oculus Quest + /(pico) (4|neo3(?: link|pro)?)/i // Pico + ], [VENDOR, MODEL, [TYPE, XR]], [ + /; (quest( \d| pro)?)/i // Oculus Quest ], [MODEL, [VENDOR, FACEBOOK], [TYPE, XR]], [ /////////////////// @@ -766,11 +823,14 @@ /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], [VERSION, [NAME, EDGE+'HTML']], [ + /(arkweb)\/([\w\.]+)/i // ArkWeb + ], [NAME, VERSION], [ + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink ], [VERSION, [NAME, 'Blink']], [ /(presto)\/([\w\.]+)/i, // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna/Servo /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab @@ -802,10 +862,22 @@ /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS ], [[NAME, 'macOS'], [VERSION, /_/g, '.']], [ + // Google Chromecast + /android ([\d\.]+).*crkey/i // Google Chromecast, Android-based + ], [VERSION, [NAME, CHROMECAST + ' Android']], [ + /fuchsia.*crkey\/([\d\.]+)/i // Google Chromecast, Fuchsia-based + ], [VERSION, [NAME, CHROMECAST + ' Fuchsia']], [ + /crkey\/([\d\.]+).*devicetype\/smartspeaker/i // Google Chromecast, Linux-based Smart Speaker + ], [VERSION, [NAME, CHROMECAST + ' SmartSpeaker']], [ + /linux.*crkey\/([\d\.]+)/i // Google Chromecast, Legacy Linux-based + ], [VERSION, [NAME, CHROMECAST + ' Linux']], [ + /crkey\/([\d\.]+)/i // Google Chromecast, unknown + ], [VERSION, [NAME, CHROMECAST]], [ + // Mobile OSes /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS - ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS - /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, + ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS/OpenHarmony + /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, // Blackberry /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS /\((series40);/i // Series 40 @@ -822,9 +894,7 @@ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS ], [VERSION, [NAME, 'watchOS']], [ - // Google Chromecast - /crkey\/([\d\.]+)/i // Google Chromecast - ], [VERSION, [NAME, CHROME+'cast']], [ + // Google ChromeOS /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS ], [[NAME, "Chrome OS"], VERSION],[ @@ -836,6 +906,7 @@ // Console /(nintendo|playstation) (\w+)/i, // Nintendo/Playstation /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) + /(pico) .+os([\w\.]+)/i, // Pico // Other /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm @@ -1186,14 +1257,21 @@ headers = extensions; // case UAParser(ua, headers) extensions = undefined; } + + // Convert Headers object into a plain object + if (headers && typeof headers.append === FUNC_TYPE) { + var kv = {}; + headers.forEach(function (v, k) { kv[k] = v; }); + headers = kv; + } if (!(this instanceof UAParser)) { return new UAParser(ua, extensions, headers).getResult(); } var userAgent = typeof ua === STR_TYPE ? ua : // Passed user-agent string - ((NAVIGATOR && NAVIGATOR.userAgent) ? NAVIGATOR.userAgent : // navigator.userAgent (headers && headers[USER_AGENT] ? headers[USER_AGENT] : // User-Agent from passed headers + ((NAVIGATOR && NAVIGATOR.userAgent) ? NAVIGATOR.userAgent : // navigator.userAgent EMPTY)), // empty string httpUACH = new UACHData(headers, true), diff --git a/src/main/ua-parser.mjs b/src/main/ua-parser.mjs index 53cddcb..1205727 100644 --- a/src/main/ua-parser.mjs +++ b/src/main/ua-parser.mjs @@ -3,7 +3,7 @@ // Source: /src/main/ua-parser.js ///////////////////////////////////////////////////////////////////////////////// -/* UAParser.js v2.0.0-beta.3 +/* UAParser.js v2.0.0-rc.3 Copyright © 2012-2024 Faisal Salman UAParser.js PRO Personal License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. @@ -21,7 +21,7 @@ // Constants ///////////// - var LIBVERSION = '2.0.0-beta.3', + var LIBVERSION = '2.0.0-rc.3', EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', @@ -42,6 +42,7 @@ WEARABLE = 'wearable', XR = 'xr', EMBEDDED = 'embedded', + INAPP = 'inapp', USER_AGENT = 'user-agent', UA_MAX_LENGTH = 500, BRANDS = 'brands', @@ -73,6 +74,7 @@ GOOGLE = 'Google', HUAWEI = 'Huawei', LENOVO = 'Lenovo', + HONOR = 'Honor', LG = 'LG', MICROSOFT = 'Microsoft', MOTOROLA = 'Motorola', @@ -84,6 +86,7 @@ PREFIX_MOBILE = 'Mobile ', SUFFIX_BROWSER = ' Browser', CHROME = 'Chrome', + CHROMECAST = 'Chromecast', EDGE = 'Edge', FIREFOX = 'Firefox', OPERA = 'Opera', @@ -321,19 +324,23 @@ // Mixed /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu ], [VERSION, [NAME, 'Baidu']], [ + /\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i // Maxthon + ], [VERSION, [NAME, 'Maxthon']], [ /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir // Trident based - /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser + /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, // Avant/IEMobile/SlimBrowser/SlimBoat/Slimjet /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer - // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon - /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar)\/([-\w\.]+)/i, - // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar - /(heytap|ovi)browser\/([\d\.]+)/i, // HeyTap/Ovi + // Blink/Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon + /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i, + // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio/Dragon + /(heytap|ovi|115)browser\/([\d\.]+)/i, // HeyTap/Ovi/115 /(weibo)__([\d\.]+)/i // Weibo ], [NAME, VERSION], [ + /quark(?:pc)?\/([-\w\.]+)/i // Quark + ], [VERSION, [NAME, 'Quark']], [ /\bddg\/([\w\.]+)/i // DuckDuckGo ], [VERSION, [NAME, 'DuckDuckGo']], [ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser @@ -366,31 +373,31 @@ ], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [ /fxios\/([\w\.-]+)/i // Firefox for iOS ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [ - /\bqihu|(qi?ho?o?|360)browser/i // 360 - ], [[NAME, '360' + SUFFIX_BROWSER]], [ + /\bqihoobrowser\/?([\w\.]*)/i // 360 + ], [VERSION, [NAME, '360']], [ /\b(qq)\/([\w\.]+)/i // QQ ], [[NAME, /(.+)/, '$1Browser'], VERSION], [ /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser /samsungbrowser\/([\w\.]+)/i // Samsung Internet ], [VERSION, [NAME, SAMSUNG + ' Internet']], [ - /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon - ], [[NAME, /_/g, ' '], VERSION], [ /metasr[\/ ]?([\d\.]+)/i // Sogou Explorer ], [VERSION, [NAME, SOGOU + ' Explorer']], [ /(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile ], [[NAME, SOGOU + ' Mobile'], VERSION], [ /(electron)\/([\w\.]+) safari/i, // Electron-based App /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla - /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser + /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i // QQ/2345 ], [NAME, VERSION], [ - /(lbbrowser|rekonq)/i, // LieBao Browser/Rekonq - /\[(linkedin)app\]/i // LinkedIn App for iOS & Android + /(lbbrowser|rekonq)/i // LieBao Browser/Rekonq ], [NAME], [ + /ome\/([\w\.]+) \w* ?(iron) saf/i, // Iron + /ome\/([\w\.]+).+qihu (360)[es]e/i // 360 + ], [VERSION, NAME], [ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android - ], [[NAME, FACEBOOK], VERSION], [ + ], [[NAME, FACEBOOK], VERSION, [TYPE, INAPP]], [ /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp @@ -398,12 +405,17 @@ /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /(alipay)client\/([\w\.]+)/i, // Alipay /(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter - /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat - ], [NAME, VERSION], [ + /(instagram|snapchat)[\/ ]([-\w\.]+)/i // Instagram/Snapchat + ], [NAME, VERSION, [TYPE, INAPP]], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS - ], [VERSION, [NAME, 'GSA']], [ + ], [VERSION, [NAME, 'GSA'], [TYPE, INAPP]], [ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok - ], [VERSION, [NAME, 'TikTok']], [ + ], [VERSION, [NAME, 'TikTok'], [TYPE, INAPP]], [ + /\[(linkedin)app\]/i // LinkedIn App for iOS & Android + ], [NAME, [TYPE, INAPP]], [ + + /(chromium)[\/ ]([-\w\.]+)/i // Chromium + ], [NAME, VERSION], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [VERSION, [NAME, CHROME+' Headless']], [ @@ -437,7 +449,7 @@ ], [[NAME, PREFIX_MOBILE + FIREFOX], VERSION], [ /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ - /(wolvic)\/([\w\.]+)/i // Wolvic + /(wolvic|librewolf)\/([\w\.]+)/i // Wolvic/LibreWolf ], [NAME, VERSION], [ /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality ], [VERSION, [NAME, FIREFOX+' Reality']], [ @@ -499,8 +511,8 @@ // Samsung /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [ - /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, - /samsung[- ]([-\w]+)/i, + /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, + /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [ @@ -518,10 +530,14 @@ /\b(sh-?[altvz]?\d\d[a-ekm]?)/i ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [ + // Honor + /(?:honor)([-\w ]+)[;\)]/i + ], [MODEL, [VENDOR, HONOR], [TYPE, MOBILE]], [ + // Huawei /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [ - /(?:huawei|honor)([-\w ]+)[;\)]/i, + /(?:huawei)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [ @@ -531,7 +547,7 @@ /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models - /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi + /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i // Xiaomi Mi ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets @@ -586,7 +602,7 @@ ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ // Sony - /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i + /droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [ /sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i @@ -599,7 +615,7 @@ // Amazon /(alexa)webm/i, - /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show + /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, // Kindle Fire without Silk / Echo Show /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone @@ -628,6 +644,17 @@ /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ + // TCL + /tcl (xess p17aa)/i, + /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i + ], [MODEL, [VENDOR, 'TCL'], [TYPE, TABLET]], [ + /droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i + ], [MODEL, [VENDOR, 'TCL'], [TYPE, MOBILE]], [ + + // itel + /(itel) ((\w+))/i + ], [[VENDOR, lowerize], MODEL, [TYPE, strMapper, { 'tablet' : ['p10001l', 'w7001'], '*' : 'mobile' }]], [ + // Acer /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ @@ -641,9 +668,28 @@ /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i ], [MODEL, [VENDOR, 'Ulefone'], [TYPE, MOBILE]], [ + // Energizer + /; (energy ?\w+)(?: bui|\))/i, + /; energizer ([\w ]+)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Energizer'], [TYPE, MOBILE]], [ + + // Cat + /; cat (b35);/i, + /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Cat'], [TYPE, MOBILE]], [ + + // Smartfren + /((?:new )?andromax[\w- ]+)(?: bui|\))/i + ], [MODEL, [VENDOR, 'Smartfren'], [TYPE, MOBILE]], [ + + // Nothing + /droid.+; (a(?:015|06[35]|142p?))/i + ], [MODEL, [VENDOR, 'Nothing'], [TYPE, MOBILE]], [ + // MIXED - /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, - // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i, + // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan + /; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i, // IMO /(hp) ([\w ]+\w)/i, // HP iPAQ /(asus)-?(\w+)/i, // Asus /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia @@ -652,6 +698,7 @@ /(oppo) ?([\w ]+) bui/i // OPPO ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(imo) (tab \w+)/i, // IMO /(kobo)\s(ereader|touch)/i, // Kobo /(archos) (gamepad2?)/i, // Archos /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad @@ -685,8 +732,14 @@ ], [[VENDOR, LG], [TYPE, SMARTTV]], [ /(apple) ?tv/i // Apple TV ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [ - /crkey/i // Google Chromecast - ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey.*devicetype\/chromecast/i // Google Chromecast Third Generation + ], [[MODEL, CHROMECAST+' Third Generation'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey.*devicetype\/([^/]*)/i // Google Chromecast with specific device type + ], [[MODEL, /^/, 'Chromecast '], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /fuchsia.*crkey/i // Google Chromecast Nest Hub + ], [[MODEL, CHROMECAST+' Nest Hub'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /crkey/i // Google Chromecast, Linux-based or unknown + ], [[MODEL, CHROMECAST], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ /droid.+aft(\w+)( bui|\))/i // Fire TV ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [ /\(dtv[\);].+(aquos)/i, @@ -722,6 +775,8 @@ // WEARABLES /////////////////// + /\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i // Samsung Galaxy Watch + ], [MODEL, [VENDOR, SAMSUNG], [TYPE, WEARABLE]], [ /((pebble))app/i // Pebble ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch @@ -735,7 +790,9 @@ /droid.+; (glass) \d/i // Google Glass ], [MODEL, [VENDOR, GOOGLE], [TYPE, XR]], [ - /(quest( \d| pro)?)/i // Oculus Quest + /(pico) (4|neo3(?: link|pro)?)/i // Pico + ], [VENDOR, MODEL, [TYPE, XR]], [ + /; (quest( \d| pro)?)/i // Oculus Quest ], [MODEL, [VENDOR, FACEBOOK], [TYPE, XR]], [ /////////////////// @@ -768,11 +825,14 @@ /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], [VERSION, [NAME, EDGE+'HTML']], [ + /(arkweb)\/([\w\.]+)/i // ArkWeb + ], [NAME, VERSION], [ + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink ], [VERSION, [NAME, 'Blink']], [ /(presto)\/([\w\.]+)/i, // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna/Servo /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab @@ -804,10 +864,22 @@ /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS ], [[NAME, 'macOS'], [VERSION, /_/g, '.']], [ + // Google Chromecast + /android ([\d\.]+).*crkey/i // Google Chromecast, Android-based + ], [VERSION, [NAME, CHROMECAST + ' Android']], [ + /fuchsia.*crkey\/([\d\.]+)/i // Google Chromecast, Fuchsia-based + ], [VERSION, [NAME, CHROMECAST + ' Fuchsia']], [ + /crkey\/([\d\.]+).*devicetype\/smartspeaker/i // Google Chromecast, Linux-based Smart Speaker + ], [VERSION, [NAME, CHROMECAST + ' SmartSpeaker']], [ + /linux.*crkey\/([\d\.]+)/i // Google Chromecast, Legacy Linux-based + ], [VERSION, [NAME, CHROMECAST + ' Linux']], [ + /crkey\/([\d\.]+)/i // Google Chromecast, unknown + ], [VERSION, [NAME, CHROMECAST]], [ + // Mobile OSes /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS - ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS - /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, + ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS/OpenHarmony + /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, // Blackberry /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS /\((series40);/i // Series 40 @@ -824,9 +896,7 @@ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS ], [VERSION, [NAME, 'watchOS']], [ - // Google Chromecast - /crkey\/([\d\.]+)/i // Google Chromecast - ], [VERSION, [NAME, CHROME+'cast']], [ + // Google ChromeOS /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS ], [[NAME, "Chrome OS"], VERSION],[ @@ -838,6 +908,7 @@ // Console /(nintendo|playstation) (\w+)/i, // Nintendo/Playstation /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) + /(pico) .+os([\w\.]+)/i, // Pico // Other /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm @@ -1188,14 +1259,21 @@ headers = extensions; // case UAParser(ua, headers) extensions = undefined; } + + // Convert Headers object into a plain object + if (headers && typeof headers.append === FUNC_TYPE) { + var kv = {}; + headers.forEach(function (v, k) { kv[k] = v; }); + headers = kv; + } if (!(this instanceof UAParser)) { return new UAParser(ua, extensions, headers).getResult(); } var userAgent = typeof ua === STR_TYPE ? ua : // Passed user-agent string - ((NAVIGATOR && NAVIGATOR.userAgent) ? NAVIGATOR.userAgent : // navigator.userAgent (headers && headers[USER_AGENT] ? headers[USER_AGENT] : // User-Agent from passed headers + ((NAVIGATOR && NAVIGATOR.userAgent) ? NAVIGATOR.userAgent : // navigator.userAgent EMPTY)), // empty string httpUACH = new UACHData(headers, true), diff --git a/test/dts-test.ts b/test/dts-test.ts index d8a8fc2..39bb4a3 100644 --- a/test/dts-test.ts +++ b/test/dts-test.ts @@ -1,6 +1,6 @@ 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"; +import { isAppleSilicon, isChromeFamily } 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 = { @@ -28,12 +28,12 @@ expectType(browser); expectType(browser.name); expectType(browser.version); expectType(browser.major); -expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module' | undefined>(browser.type); +expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'library' | undefined>(browser.type); expectType(browser.is('')); expectType(browser.toString()); expectType>(browser.withClientHints()); -expectType((browser.withClientHints()).withFeatureCheck()); -expectType((browser.withClientHints()).withFeatureCheck().is('')); +expectType>((browser.withClientHints()).withFeatureCheck()); +expectType(((browser.withClientHints()).withFeatureCheck()).is('')); expectType(parser.getCPU()); expectType(parser.getDevice()); @@ -46,4 +46,4 @@ expectType(parser.setUA(uastring)); const result = parser.getResult(); expectType(isAppleSilicon(result)); -expectType(isChromiumBased(result)); \ No newline at end of file +expectType(isChromeFamily(result)); \ No newline at end of file diff --git a/test/mocha-test-extension.js b/test/mocha-test-extension.js index c2ee99d..246bf35 100644 --- a/test/mocha-test-extension.js +++ b/test/mocha-test-extension.js @@ -8,8 +8,8 @@ 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'); +const libraries = require('./specs/browser-libraries.json'); +const { Bots, CLIs, Crawlers, Emails, Fetchers, Libraries } = require('../src/extensions/ua-parser-extensions'); describe('Extensions', () => { [ @@ -17,7 +17,7 @@ describe('Extensions', () => { ['Crawlers', crawlers, Crawlers], ['Emails', emails, Emails], ['Fetchers', fetchers, Fetchers], - ['Modules', modules, Modules] + ['Libraries', libraries, Libraries] ] .forEach((list) => { describe(list[0], () => { @@ -38,14 +38,16 @@ describe('Extensions', () => { 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)'; + assert.equal(UAParser(scrapy, Bots).browser.name, 'Scrapy'); + 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"}); + const libraryParser = new UAParser(Libraries); + assert.deepEqual(libraryParser.setUA(axios).getBrowser(), {name: "axios", version: "1.3.5", major: "1", type: "library"}); + assert.deepEqual(libraryParser.setUA(jsdom).getBrowser(), {name: "jsdom", version: "20.0.3", major: "20", type: "library"}); + assert.deepEqual(libraryParser.setUA(scrapy).getBrowser(), {name: "Scrapy", version: "1.5.0", major: "1", type: "library"}); }); describe('Merge', () => { @@ -67,7 +69,7 @@ describe('Merge', () => { }); }); -describe('Testing regexes', () => { +describe('Testing the safety of regexes', () => { let regexes; let code = fs.readFileSync('src/extensions/ua-parser-extensions.js', 'utf8').toString(); diff --git a/test/mocha-test-helpers.js b/test/mocha-test-helpers.js index faacf61..ab61cd9 100644 --- a/test/mocha-test-helpers.js +++ b/test/mocha-test-helpers.js @@ -1,6 +1,24 @@ const assert = require('assert'); const { UAParser } = require('../src/main/ua-parser'); -const { isAppleSilicon, isChromiumBased } = require('../src/helpers/ua-parser-helpers'); +const { getDeviceVendor, isAppleSilicon, isBot, isChromeFamily } = require('../src/helpers/ua-parser-helpers'); +const { Bots, Emails } = require('../src/extensions/ua-parser-extensions'); + +describe('getDeviceVendor', () => { + it('Can guess the device vendor from a model name', () => { + + const modelSM = 'SM-A605G'; + const modelRedmi = 'Redmi Note 8'; + const modelNexus = 'Nexus 6P'; + const modelQuest = 'Quest 3'; + const modelAquos = 'AQUOS-TVX19B'; + + assert.equal(getDeviceVendor(modelSM), 'Samsung'); + assert.equal(getDeviceVendor(modelRedmi), 'Xiaomi'); + assert.equal(getDeviceVendor(modelNexus), 'Huawei'); + assert.equal(getDeviceVendor(modelQuest), 'Facebook'); + assert.equal(getDeviceVendor(modelAquos), 'Sharp'); + }); +}); describe('isAppleSilicon', () => { it('Can detect Apple Silicon device', () => { @@ -14,13 +32,30 @@ describe('isAppleSilicon', () => { }); }); -describe('isChromiumBased', () => { +describe('isBot', () => { + it('Can detect Bots', () => { + + // non-real ua + const ahrefsBot = 'Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)'; + const firefox = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0'; + const scrapy = 'Scrapy/1.5.0 (+https://scrapy.org)'; + const thunderbird = 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0'; + + const botParser = new UAParser(firefox, { Bots, Emails }); + assert.equal(isBot(botParser.getResult()), false); + assert.equal(isBot(botParser.setUA(ahrefsBot).getResult()), true); + assert.equal(isBot(botParser.setUA(scrapy).getResult()), true); + assert.equal(isBot(botParser.setUA(thunderbird).getResult()), false); + }); +}); + +describe('isChromeFamily', () => { 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); + assert.equal(isChromeFamily(UAParser(edge)), true); + assert.equal(isChromeFamily(UAParser(firefox)), false); }); }); \ No newline at end of file diff --git a/test/mocha-test.js b/test/mocha-test.js index 7b5e711..68213ac 100644 --- a/test/mocha-test.js +++ b/test/mocha-test.js @@ -17,7 +17,7 @@ var methods = [ title : 'getBrowser', label : 'browser', list : browsers, - properties : ['name', 'major', 'version'] + properties : ['name', 'major', 'version', 'type'] }, { title : 'getCPU', diff --git a/test/playwright-test-main.spec.mjs b/test/playwright-test-main.spec.mjs index e830bbf..db6e149 100644 --- a/test/playwright-test-main.spec.mjs +++ b/test/playwright-test-main.spec.mjs @@ -4,75 +4,140 @@ 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.describe('Custom navigator.userAgent tests', () => { + + test('Undefined navigator.userAgent regarded as an empty user-agent string', async ({ page }) => { + await page.addInitScript(() => { + Object.defineProperty(navigator, 'userAgent', { + value: undefined + }); + }); + await page.goto(localHtml); + // @ts-ignore + const uap = await page.evaluate(async () => await UAParser()); + expect(uap).toHaveProperty('ua', ''); + expect(uap).toHaveProperty('browser.name', undefined); + }); +}); + +test.describe('User-defined user-agent tests', () => { + test.beforeEach(async ({ page }) => { await page.goto(localHtml); }); - test('accept empty string', async ({ page }) => { + test('Accept empty user-agent', async ({ page }) => { // @ts-ignore const uap = await page.evaluate(async () => await UAParser('')); expect(uap).toHaveProperty('ua', ''); }); + + test('Truncate very long user-agent', async ({ page }) => { + // @ts-ignore + const uap = await page.evaluate(async () => await UAParser('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; (R1 1.6); SLCC1; .NET CLR 2.0.50727; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; 66760635803; runtime 11.00294; 876906799603; 97880703; 669602703; 9778063903; 877905603; 89670803; 96690803; 8878091903; 7879040603; 999608065603; 799808803; 6666059903; 669602102803; 888809342903; 696901603; 788907703; 887806555703; 97690214703; 66760903; 968909903; 796802422703; 8868026703; 889803611803; 898706903; 977806408603; 976900799903; 9897086903; 88780803; 798802301603; 9966008603; 66760703; 97890452603; 9789064803; 96990759803; 99960107703; 8868087903; 889801155603; 78890703; 8898070603; 89970603; 89970539603; 89970488703; 8789007603; 87890903; 877904603; 9887077703; 798804903; 97890264603; 967901703; 87890703; 97690420803; 79980706603; 9867086703; 996602846703; 87690803; 6989010903; 977809603; 666601903; 876905337803; 89670603; 89970200903; 786903603; 696901911703; 788905703; 896709803; 96890703; 998601903; 88980703; 666604769703; 978806603; 7988020803; 996608803; 788903297903; 98770043603; 899708803; 66960371603; 9669088903; 69990703; 99660519903; 97780603; 888801803; 9867071703; 79780803; 9779087603; 899708603; 66960456803; 898706824603; 78890299903; 99660703; 9768079803; 977901591603; 89670605603; 787903608603; 998607934903; 799808573903; 878909603; 979808146703; 9996088603; 797803154903; 69790603; 99660565603; 7869028603; 896707703; 97980965603; 976907191703; 88680703; 888809803; 69690903; 889805523703; 899707703; 997605035603; 89970029803; 9699094903; 877906803; 899707002703; 786905857603; 69890803; 97980051903; 997603978803; 9897097903; 66960141703; 7968077603; 977804603; 88980603; 989700803; 999607887803; 78690772803; 96990560903; 98970961603; 9996032903; 9699098703; 69890655603; 978903803; 698905066803; 977806903; 9789061703; 967903747703; 976900550903; 88980934703; 8878075803; 8977028703; 97980903; 9769006603; 786900803; 98770682703; 78790903; 878906967903; 87690399603; 99860976703; 796805703; 87990603; 968906803; 967904724603; 999606603; 988705903; 989702842603; 96790603; 99760703; 88980166703; 9799038903; 98670903; 697905248603; 7968043603; 66860703; 66860127903; 9779048903; 89670123903; 78890397703; 97890603; 87890803; 8789030603; 69990603; 88880763703; 9769000603; 96990203903; 978900405903; 7869022803; 699905422903; 97890703; 87990903; 878908703; 7998093903; 898702507603; 97780637603; 966907903; 896702603; 9769004803; 7869007903; 99660158803; 7899099603; 8977055803; 99660603; 7889080903; 66660981603; 997604603; 6969089803; 899701903; 9769072703; 666603903; 99860803; 997608803; 69790903; 88680756703; 979805677903; 9986047703; 89970803; 66660603; 96690903; 8997051603; 789901209803; 8977098903; 968900326803; 87790703; 98770024803; 697901794603; 69990803; 887805925803; 968908903; 97880603; 897709148703; 877909476903; 66760197703; 977908603; 698902703; 988706504803; 977802026603; 88680964703; 8878068703; 987705107903; 978902878703; 8898069803; 9768031703; 79680803; 79980803; 669609328703; 89870238703; 99960593903; 969904218703; 78890603; 9788000703; 69690630903; 889800982903; 988709748803; 7968052803; 99960007803; 969900800803; 668604817603; 66960903; 78790734603; 8868007703; 79780034903; 8878085903; 976907603; 89670830803; 877900903; 969904889703; 7978033903; 8987043903; 99860703; 979805903; 667603803; 976805348603; 999604127603; 97790701603; 78990342903; 98770672903; 87990253903; 9877027703; 97790803; 877901895603; 8789076903; 896708595603; 997601903; 799806903; 97690603; 87790371703; 667605603; 99760303703; 97680283803; 788902750803; 787909803; 79780603; 79880866903; 9986050903; 87890543903; 979800803; 97690179703; 876901603; 699909903; 96990192603; 878904903; 877904734903; 796801446903; 977904803; 9887044803; 797805565603; 98870789703; 7869093903; 87790727703; 797801232803; 666604803; 9778071903; 9799086703; 6969000903; 89670903; 8799075903; 897708903; 88680903; 97980362603; 97980503903; 889803256703; 88980388703; 789909376803; 69690703; 6969025903; 89970309903; 96690703; 877901847803; 968901903; 96690603; 88680607603; 7889001703; 789904761803; 976807703; 976902903; 878907889703; 9897014903; 896707046603; 696909903; 666603998903; 969902703; 79680421803; 9769075603; 798800192703; 97990903; 9689024903; 668604803; 969908671903; 9996094703; 69990642703; 97890895903; 977805619903; 79980859903; 88980443803; 98970649603; 997602703; 888802169903; 699907803; 667602028803; 786903283903; 997607703; 969909803; 798809925903; 9976045603; 97790903; 9789001903; 966903603; 9789069603; 968906603; 6989091803; 896701603; 6979059803; 978803903; 997606362603; 88980803; 98970803; 88880921703; 8997065703; 899700703; 698908703; 797801027903; 7889050903; 87890603; 78690703; 99660069703; 97980309903; 976800603; 666606803; 898707703; 79880019803; 66960250803; 7978049803; 88780602603; 79680903; 88880792703; 96990903; 667608603; 87790730903; 98970903; 9699032903; 8987004803; 88880703; 89770046603; 978800803; 969908903; 9798022603; 696901903; 799803703; 989703703; 668605903; 79780903; 998601371703; 796803339703; 87890922603; 898708903; 9966061903; 66960891903; 96790903; 8779050803; 98870858803; 976909298603; 9887029903; 669608703; 979806903; 878903803; 99960703; 9789086703; 979801803; 66960008703; 979806830803; 99760212703; 786906603; 797807603; 789907297703; 96990703; 786901603; 796807766603; 896702651603; 789902585603; 66660925903; 9986085703; 66960302703; 69890703; 789900703; 89970903; 9679060703; 9789002903; 979908821603; 986708140803; 976809828703; 7988082803; 79680997903; 99960803; 9788081903; 979805703; 787908603; 66960602803; 9887098703; 978803237703; 888806804603; 999604703; 977904703; 966904635703; 97680291703; 977809345603; 8878046703; 988709803; 976900773603; 989703903; 88780198603; 87790603; 986708703; 78890604703; 87790544803; 976809850903; 887806703; 987707527603; 79880803; 9897059603; 897709820603; 97880804803; 66960026703; 9789062803; 9867090803; 669600603; 8967087703; 78890903; 89770903; 97980703; 976802687603; 66860400803; 979901288603; 96990160903; 99860228903; 966900703; 66760603; 9689035703; 9779064703; 7968023603; 87890791903; 98770870603; 9798005803; 6969087903; 9779097903; 6979065703; 699903252603; 79780989703; 87690901803; 978905763903; 977809703; 97790369703; 899703269603; 8878012703; 78790803; 87690395603; 8888042803; 667607689903; 8977041803; 6666085603; 6999080703; 69990797803; 88680721603; 99660519803; 889807603; 87890146703; 699906325903; 89770603; 669608615903; 9779028803; 88880603; 97790703; 79780703; 97680355603; 6696024803; 78790784703; 97880329903; 9699077703; 89870803; 79680227903; 976905852703; 8997098903; 896704796703; 66860598803; 9897036703; 66960703; 9699094703; 9699008703; 97780485903; 999603179903; 89770834803; 96790445603; 79680460903; 9867009603; 89870328703; 799801035803; 989702903; 66960758903; 66860150803; 6686088603; 9877092803; 96990603; 99860603; 987703663603; 98870903; 699903325603; 87790803; 97680703; 8868030703; 9799030803; 89870703; 97680803; 9669054803; 6979097603; 987708046603; 999608603; 878904803; 998607408903; 968903903; 696900703; 977907491703; 6686033803; 669601803; 99960290603; 887809169903; 979803703; 69890903; 699901447903; 8987064903; 799800603; 98770903; 8997068703; 967903603; 66760146803; 978805087903; 697908138603; 799801603; 88780964903; 989708339903; 8967048603; 88880981603; 789909703; 796806603; 977905977603; 989700603; 97780703; 9669062603; 88980714603; 897709545903; 988701916703; 667604694903; 786905664603; 877900803; 886805490903; 89970559903; 99960531803; 7998033903; 98770803; 78890418703; 669600872803; 996605216603; 78690962703; 667604903; 996600903; 999608903; 9699083803; 787901803; 97780707603; 787905312703; 977805803; 8977033703; 97890708703; 989705521903; 978800703; 698905703; 78890376903; 878907703; 999602903; 986705903; 668602719603; 979901803; 997606903; 66760393903; 987703603; 78790338903; 96890803; 97680596803; 666601603; 977902178803; 877902803; 78790038603; 8868075703; 99960060603)')); + + expect(uap).toHaveProperty('ua', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; (R1 1.6); SLCC1; .NET CLR 2.0.50727; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; 66760635803; runtime 11.00294; 876906799603; 97880703; 669602703; 9778063903; 877905603; 89670803; 96690803; 8878091903; 7879040603; 999608065603; 799808803; 6666059903; 669602102803; 888809342903; 696901603; 788907703; 887806555703; 97690214703; 66760903; 968909903; 796802422703; 8868026703; 8898036'); + }); }); -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' - }); +test.describe('withClientHints() tests', () => { + + test('Detect custom 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); }); - - 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 - } +test.describe('withFeatureCheck() tests', () => { + + 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'); }); - await page.goto(localHtml); - // @ts-ignore - let uap = await page.evaluate(() => UAParser()); - expect(uap).toHaveProperty('browser.name', 'Chrome Headless'); + test('Detect iPad', async ({ page }) => { + await page.addInitScript(() => { + Object.defineProperty(navigator, 'userAgent', { + value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15' + }); + Object.defineProperty(navigator, 'standalone', { + value: true + }); + Object.defineProperty(navigator, 'maxTouchPoints', { + value: 3 + }); + }); + await page.goto(localHtml); + // @ts-ignore + let uap = await page.evaluate(() => UAParser()); + expect(uap).toHaveProperty('device.model', 'Macintosh'); + expect(uap).toHaveProperty('device.type', undefined); + // @ts-ignore + uap = await page.evaluate(() => UAParser().withFeatureCheck()); + expect(uap).toHaveProperty('device.model', 'iPad'); + expect(uap).toHaveProperty('device.type', 'tablet'); + }); +}); - // @ts-ignore - uap = await page.evaluate(() => UAParser().withFeatureCheck()); - expect(uap).toHaveProperty('browser.name', 'Brave'); -}); \ No newline at end of file +test.describe('request.headers can be passed in form of a Headers object', () => { + + test('Headers automatically converted into a plain key-value object', async ({ page }) => { + await page.addInitScript(() => { + Object.defineProperty(window, 'req', { + value : { + headers: new Headers([["User-Agent", "myBrowser/1.0"]]) + } + }); + }); + await page.goto(localHtml); + // @ts-ignore + const uap = await page.evaluate(() => UAParser(req.headers)); + expect(uap.ua).toBe('myBrowser/1.0'); + }); +}); diff --git a/test/specs/browser-all.json b/test/specs/browser-all.json index a9b22df..8698597 100644 --- a/test/specs/browser-all.json +++ b/test/specs/browser-all.json @@ -1,12 +1,72 @@ [ + { + "desc" : "115 Browser", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 115Browser/24.3.0.3", + "expect" : + { + "name" : "115", + "version" : "24.3.0.3", + "major" : "24" + } + }, + { + "desc" : "2345 Browser", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; MI NOTE Pro Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36 Mb2345Browser/15.6.2", + "expect" : + { + "name" : "2345", + "version" : "15.6.2", + "major" : "15" + } + }, + { + "desc" : "2345 Chrome", + "ua" : "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML like Gecko) Chrome/39.0.2171.99 Safari/537.36 2345chrome v3.0.0.9739", + "expect" : + { + "name" : "2345", + "version" : "3.0.0.9739", + "major" : "3" + } + }, + { + "desc" : "2345 Explorer", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116", + "expect" : + { + "name" : "2345", + "version" : "9.2.1.17116", + "major" : "9" + } + }, { "desc" : "360 Browser on iOS", "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/607.3.9 (KHTML, like Gecko) Mobile/16G102 QHBrowser/317 QihooBrowser/4.0.10", "expect" : { - "name" : "360 Browser", - "version" : "undefined", - "major" : "undefined" + "name" : "360", + "version" : "4.0.10", + "major" : "4" + } + }, + { + "desc" : "360 Secure Browser on Windows 10", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36 QIHU 360SE", + "expect" : + { + "name" : "360", + "version" : "86.0.4240.198", + "major" : "86" + } + }, + { + "desc" : "360 Speed Browser on Windows 10", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36 QIHU 360EE", + "expect" : + { + "name" : "360", + "version" : "86.0.4240.198", + "major" : "86" } }, { @@ -16,7 +76,8 @@ { "name" : "Alipay", "version" : "10.2.51.7100", - "major" : "10" + "major" : "10", + "type" : "inapp" } }, { @@ -26,7 +87,8 @@ { "name" : "Alipay", "version" : "10.3.50.9999", - "major" : "10" + "major" : "10", + "type" : "inapp" } }, { @@ -404,11 +466,21 @@ "ua" : "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.7 (KHTML, like Gecko) Comodo_Dragon/16.1.1.0 Chrome/16.0.912.63 Safari/535.7", "expect" : { - "name" : "Comodo Dragon", + "name" : "Dragon", "version" : "16.1.1.0", "major" : "16" } }, + { + "desc" : "Comodo Dragon", + "ua" : "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Dragon/98.0.4758.102 Chrome/98.0.4758.102 Safari/537.36", + "expect" : + { + "name" : "Dragon", + "version" : "98.0.4758.102", + "major" : "98" + } + }, { "desc" : "Conkeror", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:6.0.1) Gecko/20110831 conkeror/0.9.3", @@ -536,7 +608,8 @@ { "name" : "Facebook", "version" : "35.0.0.48.273", - "major" : "35" + "major" : "35", + "type" : "inapp" } }, { @@ -546,7 +619,8 @@ { "name" : "Facebook", "version" : "91.0.0.41.73", - "major" : "91" + "major" : "91", + "type" : "inapp" } }, { @@ -556,7 +630,8 @@ { "name" : "Facebook", "version" : "undefined", - "major" : "undefined" + "major" : "undefined", + "type" : "inapp" } }, { @@ -566,7 +641,8 @@ { "name" : "Klarna", "version" : "23.36.223", - "major" : "23" + "major" : "23", + "type" : "inapp" } }, { @@ -576,7 +652,8 @@ { "name" : "Klarna", "version" : "23.36.215", - "major" : "23" + "major" : "23", + "type" : "inapp" } }, { @@ -586,7 +663,8 @@ { "name" : "Instagram", "version" : "142.0.0.22.109", - "major" : "142" + "major" : "142", + "type" : "inapp" } }, { @@ -698,6 +776,16 @@ "major" : "1" } }, + { + "desc" : "Helio", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Helio/0.98.20", + "expect" : + { + "name" : "Helio", + "version" : "0.98.20", + "major" : "0" + } + }, { "desc" : "HeyTap", "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.61 Safari/537.36 HeyTapBrowser/40.8.10.1", @@ -838,6 +926,26 @@ "major" : "22" } }, + { + "desc" : "Iron", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Iron Safari/537.36", + "expect" : + { + "name" : "Iron", + "version" : "129.0.0.0", + "major" : "129" + } + }, + { + "desc" : "Iron", + "ua" : "Mozilla/5.0 (Linux; Android 11; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Iron Safari/537.36", + "expect" : + { + "name" : "Iron", + "version" : "113.0.0.0", + "major" : "113" + } + }, { "desc" : "Jasmine", "ua" : "SAMSUNG-S8000/S8000XXIF3 SHP/VPP/R5 Jasmine/1.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1", @@ -908,6 +1016,16 @@ "major" : "3" } }, + { + "desc" : "PicoBrowser", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.8.2 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.38 Chrome/105.0.5195.68 VR Safari/537.36", + "expect" : + { + "name" : "Pico Browser", + "version" : "3.3.38", + "major" : "3" + } + }, { "desc" : "PicoBrowser", "ua" : "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36 OculusBrowser/7.0", @@ -948,6 +1066,26 @@ "major" : "9" } }, + { + "desc" : "LibreWolf", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 LibreWolf/91.0", + "expect" : + { + "name" : "LibreWolf", + "version" : "91.0", + "major" : "91" + } + }, + { + "desc" : "LibreWolf", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0 LibreWolf/97.0.1", + "expect" : + { + "name" : "LibreWolf", + "version" : "97.0.1", + "major" : "97" + } + }, { "desc" : "LINE on Android", "ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB", @@ -955,7 +1093,8 @@ { "name" : "Line", "version" : "6.5.1", - "major" : "6" + "major" : "6", + "type" : "inapp" } }, { @@ -965,7 +1104,8 @@ { "name" : "Line", "version" : "8.4.1", - "major" : "8" + "major" : "8", + "type" : "inapp" } }, { @@ -999,7 +1139,57 @@ } }, { - "desc" : "Maxthon", + "desc" : "Maxthon on Android", + "ua" : "Mozilla/5.0 (Linux; Android 5.1.1; KFAUWI Build/LVY48F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.127 Safari/537.36 MxBrowser/4.3.5.2000", + "expect" : + { + "name" : "Maxthon", + "version" : "4.3.5.2000", + "major" : "4" + } + }, + { + "desc" : "Maxthon on iOS", + "ua" : "Mozilla/5.0 (iPad; CPU OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/10.0 Mobile/15E148 Safari/602.1 MXiOS/5.4.5.2", + "expect" : + { + "name" : "Maxthon", + "version" : "5.4.5.2", + "major" : "5" + } + }, + { + "desc" : "Maxthon on Linux", + "ua" : "Mozilla/5.0 (X11; Linux i686; Ubuntu 14.04.3 LTS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36", + "expect" : + { + "name" : "Maxthon", + "version" : "1.0.5.3", + "major" : "1" + } + }, + { + "desc" : "Maxthon on macOS", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6 Maxthon/5.1.102", + "expect" : + { + "name" : "Maxthon", + "version" : "5.1.102", + "major" : "5" + } + }, + { + "desc" : "Maxthon on Windows Server 2003", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; MyIE2; .NET CLR 1.1.4322)", + "expect" : + { + "name" : "Maxthon", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Maxthon on Windows XP", "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)", "expect" : { @@ -1008,6 +1198,16 @@ "major" : "undefined" } }, + { + "desc" : "Maxthon on Windows 10", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.2000", + "expect" : + { + "name" : "Maxthon", + "version" : "5.2.7.2000", + "major" : "5" + } + }, { "desc" : "Midori", "ua" : "Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+", @@ -1398,6 +1598,16 @@ "major" : "5" } }, + { + "desc" : "Quark", + "ua" : "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/112.0.0.0 safari/537.36 quarkpc/1.5.5.75", + "expect" : + { + "name" : "Quark", + "version" : "1.5.5.75", + "major" : "1" + } + }, { "desc" : "QupZilla", "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.9 Safari/538.1", @@ -1569,16 +1779,36 @@ "major" : "2" } }, + { + "desc" : "SlimBoat", + "ua" : "Mozilla/5.0 (Windows NT 5.2) AppleWebKit/534.34 (KHTML, like Gecko) SlimBoat/1.1.23 Chrome/11.0.696.7 Version/5.1 Safari/534.34", + "expect" : + { + "name" : "SlimBoat", + "version" : "1.1.23", + "major" : "1" + } + }, { "desc" : "SlimBrowser", "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)", "expect" : { - "name" : "Slim", + "name" : "SlimBrowser", "version" : "undefined", "major" : "undefined" } }, + { + "desc" : "Slimjet", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36 Slimjet/20.0.2.0", + "expect" : + { + "name" : "Slimjet", + "version" : "20.0.2.0", + "major" : "20" + } + }, { "desc" : "Swiftfox", "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)", @@ -2026,7 +2256,8 @@ { "name" : "GSA", "version" : "30.1.161623614", - "major" : "30" + "major" : "30", + "type" : "inapp" } }, { @@ -2057,16 +2288,6 @@ "name" : "LBBROWSER" } }, - { - "desc" : "2345 Browser", - "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116", - "expect" : - { - "name" : "2345Explorer", - "version" : "9.2.1.17116", - "major" : "9" - } - }, { "desc" : "QQBrowserLite", "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14 QQBrowserLite/1.1.0", @@ -2122,7 +2343,8 @@ "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [LinkedInApp]", "expect" : { - "name" : "LinkedIn" + "name" : "LinkedIn", + "type" : "inapp" } }, { @@ -2227,7 +2449,8 @@ "expect" : { "name" : "KAKAOTALK", "version": "2409760", - "major" : "2409760" + "major" : "2409760", + "type" : "inapp" } }, { @@ -2236,7 +2459,8 @@ "expect" : { "name" : "KAKAOSTORY", "version": "6.8.3_21046", - "major" : "6" + "major" : "6", + "type" : "inapp" } }, { @@ -2245,7 +2469,8 @@ "expect" : { "name" : "KAKAOTALK", "version": "9.7.6", - "major" : "9" + "major" : "9", + "type" : "inapp" } }, { @@ -2254,7 +2479,8 @@ "expect" : { "name" : "NAVER", "version": "11.11.2", - "major" : "11" + "major" : "11", + "type" : "inapp" } }, { @@ -2263,7 +2489,8 @@ "expect" : { "name" : "NAVER", "version": "10.25.0", - "major" : "10" + "major" : "10", + "type" : "inapp" } }, { @@ -2272,7 +2499,8 @@ "expect" : { "name" : "TikTok", "version": "21.9.4", - "major" : "21" + "major" : "21", + "type" : "inapp" } }, { @@ -2281,7 +2509,8 @@ "expect" : { "name" : "TikTok", "version": "21.1.0", - "major" : "21" + "major" : "21", + "type" : "inapp" } }, { @@ -2290,7 +2519,8 @@ "expect" : { "name" : "TikTok", "version": "28.3.4", - "major" : "28" + "major" : "28", + "type" : "inapp" } }, { @@ -2330,7 +2560,8 @@ { "name" : "Snapchat", "version" : "12.33.0.36", - "major" : "12" + "major" : "12", + "type" : "inapp" } }, { @@ -2340,7 +2571,8 @@ { "name" : "Twitter", "version" : "undefined", - "major" : "undefined" + "major" : "undefined", + "type" : "inapp" } }, { @@ -2350,7 +2582,8 @@ { "name" : "Twitter", "version" : "10.34", - "major" : "10" + "major" : "10", + "type" : "inapp" } } ] \ No newline at end of file diff --git a/test/specs/browser-crawlers.json b/test/specs/browser-crawlers.json index b72beb2..e527740 100644 --- a/test/specs/browser-crawlers.json +++ b/test/specs/browser-crawlers.json @@ -1,4 +1,54 @@ [ + { + "desc" : "360Spider", + "ua" : "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0); 360Spider", + "expect" : + { + "name" : "360Spider", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "AdsBot Mobile Web", + "ua" : "AdsBot-Google (+http://www.google.com/adsbot.html)", + "expect" : + { + "name" : "AdsBot-Google", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "AdsBot Mobile Web", + "ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)", + "expect" : + { + "name" : "AdsBot-Google-Mobile", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "AdSense", + "ua" : "Mediapartners-Google", + "expect" : + { + "name" : "Mediapartners-Google", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "AhrefsBot", + "ua" : "Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)", + "expect" : + { + "name" : "AhrefsBot", + "version" : "7.0", + "type" : "crawler" + } + }, { "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)", @@ -39,6 +89,36 @@ "type" : "crawler" } }, + { + "desc" : "CCBot", + "ua" : "CCBot/1.0 (+https://commoncrawl.org/bot.html)", + "expect" : + { + "name" : "CCBot", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Coc Coc Bot (web)", + "ua" : "Mozilla/5.0 (compatible; coccocbot-web/1.0; +http://help.coccoc.com/searchengine)", + "expect" : + { + "name" : "coccocbot-web", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Coc Coc Bot (image)", + "ua" : "Mozilla/5.0 (compatible; coccocbot-image/1.0; +http://help.coccoc.com/searchengine)", + "expect" : + { + "name" : "coccocbot-image", + "version" : "1.0", + "type" : "crawler" + } + }, { "desc" : "ClaudeWeb", "ua" : "Claude-Web/1.0 (web crawler; +https://www.anthropic.com/; bots@anthropic.com)", @@ -49,6 +129,36 @@ "type" : "crawler" } }, + { + "desc" : "DataForSEO", + "ua" : "Mozilla/5.0 (compatible; DataForSeoBot; +https://dataforseo.com/dataforseo-bot) ", + "expect" : + { + "name" : "DataForSeoBot", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "Dotbot", + "ua" : "Mozilla/5.0 (compatible; DotBot/1.2; +https://opensiteexplorer.org/dotbot; help@moz.com)", + "expect" : + { + "name" : "DotBot", + "version" : "1.2", + "type" : "crawler" + } + }, + { + "desc" : "Exabot", + "ua" : "Mozilla/5.0 (compatible; Exabot/3.0; +http://www.exabot.com/go/robot)", + "expect" : + { + "name" : "Exabot", + "version" : "3.0", + "type" : "crawler" + } + }, { "desc" : "FacebookBot", "ua" : "Mozilla/5.0 (compatible; FacebookBot/1.0; +https://developers.facebook.com/docs/sharing/webmasters/facebookbot/", @@ -59,6 +169,26 @@ "type" : "crawler" } }, + { + "desc" : "FacebookExternalHit", + "ua" : "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)", + "expect" : + { + "name" : "facebookexternalhit", + "version" : "1.1", + "type" : "crawler" + } + }, + { + "desc" : "FacebookExternalHit", + "ua" : "facebookcatalog/1.0", + "expect" : + { + "name" : "facebookcatalog", + "version" : "1.0", + "type" : "crawler" + } + }, { "desc" : "Googlebot-Video", "ua" : "Googlebot-Video/1.0", @@ -69,6 +199,106 @@ "type" : "crawler" } }, + { + "desc" : "Googlebot", + "ua" : "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", + "expect" : + { + "name" : "Googlebot", + "version" : "2.1", + "type" : "crawler" + } + }, + { + "desc" : "Googlebot Image", + "ua" : "Googlebot-Image/1.0", + "expect" : + { + "name" : "Googlebot-Image", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Googlebot Video", + "ua" : "Googlebot-Video/1.0", + "expect" : + { + "name" : "Googlebot-Video", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Googlebot News", + "ua" : "Googlebot-News/1.0", + "expect" : + { + "name" : "Googlebot-News", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Google Storebot", + "ua" : "Storebot-Google/1.0", + "expect" : + { + "name" : "Storebot-Google", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Google InspectionTool", + "ua" : "Mozilla/5.0 (compatible; Google-InspectionTool/1.0;)", + "expect" : + { + "name" : "Google-InspectionTool", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "GoogleOther", + "ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GoogleOther) Chrome/41.0.2272.96 Safari/537.36", + "expect" : + { + "name" : "GoogleOther", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "GoogleOther-Image", + "ua" : "GoogleOther-Image/1.0", + "expect" : + { + "name" : "GoogleOther-Image", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "GoogleOther-Video", + "ua" : "GoogleOther-Video/1.0", + "expect" : + { + "name" : "GoogleOther-Video", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "Google-Safety", + "ua" : "Google-Safety", + "expect" : + { + "name" : "Google-Safety", + "version" : "undefined", + "type" : "crawler" + } + }, { "desc" : "GPTBot", "ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)", @@ -79,6 +309,127 @@ "type" : "crawler" } }, + { + "desc" : "Archive.org Bot", + "ua" : "ia_archiver/8.1 (Windows 2000 1.9; en-US;)", + "expect" : + { + "name" : "ia_archiver", + "version" : "8.1", + "type" : "crawler" + } + }, + { + "desc" : "Archive.org Bot", + "ua" : "Mozilla/5.0 (compatible; archive.org_bot/3.3.0 +https://archive.org/details/archive.org_bot)", + "expect" : + { + "name" : "archive.org_bot", + "version" : "3.3.0", + "type" : "crawler" + } + }, + { + "desc" : "Meta-ExternalAgent", + "ua" : "meta-externalagent/1.1 (+https://developers.facebook.com/docs/sharing/webmasters/crawler)", + "expect" : + { + "name" : "meta-externalagent", + "version" : "1.1", + "type" : "crawler" + } + }, + { + "desc" : "MJ12bot", + "ua" : "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)", + "expect" : + { + "name" : "MJ12bot", + "version" : "v1.4.8", + "major" : "1", + "type" : "crawler" + } + }, + { + "desc" : "MojeekBot", + "ua" : "Mozilla/5.0 (compatible; MojeekBot/0.11; +https://www.mojeek.com/bot.html)", + "expect" : + { + "name" : "MojeekBot", + "version" : "0.11", + "type" : "crawler" + } + }, + { + "desc" : "OpenAI Search", + "ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot", + "expect" : + { + "name" : "OAI-SearchBot", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "PerplexityBot", + "ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)", + "expect" : + { + "name" : "PerplexityBot", + "version" : "1.0", + "type" : "crawler" + } + }, + { + "desc" : "PetalBot", + "ua" : "Mozilla/5.0 (compatible;PetalBot; +https://webmaster.petalsearch.com/site/petalbot) ", + "expect" : + { + "name" : "PetalBot", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "PetalBot", + "ua" : "Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; PetalBot;+https://webmaster.petalsearch.com/site/petalbot) ", + "expect" : + { + "name" : "PetalBot", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "SemrushBot", + "ua" : "Mozilla/5.0 (compatible; SemrushBot/7~bl; +http://www.semrush.com/bot.html)", + "expect" : + { + "name" : "SemrushBot", + "version" : "7", + "type" : "crawler" + } + }, + { + "desc" : "TurnitinBot", + "ua" : "TurnitinBot (https://turnitin.com/robot/crawlerinfo.html)", + "expect" : + { + "name" : "TurnitinBot", + "version" : "undefined", + "type" : "crawler" + } + }, + { + "desc" : "Yahoo! Japan", + "ua" : "Y!J-BRW/1.0 (https://www.yahoo-help.jp/app/answers/detail/p/595/a_id/42716)", + "expect" : + { + "name" : "Y!J-BRW", + "version" : "1.0", + "type" : "crawler" + } + }, { "desc" : "YandexBot", "ua" : "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)", @@ -88,5 +439,35 @@ "version" : "3.0", "type" : "crawler" } + }, + { + "desc" : "Yeti", + "ua" : "Mozilla/5.0 (compatible; Yeti/1.1; +http://naver.me/spd)", + "expect" : + { + "name" : "Yeti", + "version" : "1.1", + "type" : "crawler" + } + }, + { + "desc" : "YisouSpider", + "ua" : "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 YisouSpider/5.0 Safari/537.36", + "expect" : + { + "name" : "YisouSpider", + "version" : "5.0", + "type" : "crawler" + } + }, + { + "desc" : "YisouSpider", + "ua" : "YisouSpider", + "expect" : + { + "name" : "YisouSpider", + "version" : "undefined", + "type" : "crawler" + } } ] diff --git a/test/specs/browser-emails.json b/test/specs/browser-emails.json index 1ce6b30..883f32b 100644 --- a/test/specs/browser-emails.json +++ b/test/specs/browser-emails.json @@ -1,4 +1,64 @@ [ + { + "desc" : "Evolution", + "ua" : "Evolution/3.52.3", + "expect" : + { + "name" : "Evolution", + "version" : "3.52.3", + "type" : "email" + } + }, + { + "desc" : "KMail", + "ua" : "KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; )", + "expect" : + { + "name" : "KMail", + "version" : "4.14.10", + "type" : "email" + } + }, + { + "desc" : "KMail2", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) kmail2/5.7.3 Safari/534.34", + "expect" : + { + "name" : "kmail2", + "version" : "5.7.3", + "type" : "email" + } + }, + { + "desc" : "Kontact", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) kontact/4.13.3 Safari/534.34", + "expect" : + { + "name" : "kontact", + "version" : "4.13.3", + "type" : "email" + } + }, + { + "desc" : "Microsoft Outlook", + "ua" : "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.5431; Pro)", + "expect" : + { + "name" : "Microsoft Outlook", + "version" : "16.0.5431", + "type" : "email" + } + }, + { + "desc" : "Microsoft Outlook for Mac", + "ua" : "MacOutlook/14.7.1.161129 (Intel Mac OS X 10.9.6)", + "expect" : + { + "name" : "MacOutlook", + "version" : "14.7.1.161129", + "type" : "email" + } + }, { "desc" : "Thunderbird", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0", diff --git a/test/specs/browser-fetchers.json b/test/specs/browser-fetchers.json index 646f07b..94bada0 100644 --- a/test/specs/browser-fetchers.json +++ b/test/specs/browser-fetchers.json @@ -1,4 +1,14 @@ [ + { + "desc" : "AhrefsSiteAudit", + "ua" : "Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.128 Mobile Safari/537.36 (compatible; AhrefsSiteAudit/6.1; +http://ahrefs.com/robot/site-audit)", + "expect" : + { + "name" : "AhrefsSiteAudit", + "version" : "6.1", + "type" : "fetcher" + } + }, { "desc" : "BingPreview", "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b", @@ -8,5 +18,105 @@ "version" : "1.0b", "type" : "fetcher" } + }, + { + "desc" : "ChatGPT-User", + "ua" : "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot", + "expect" : + { + "name" : "ChatGPT-User", + "version" : "1.0", + "type" : "fetcher" + } + }, + { + "desc" : "DuckAssistBot", + "ua" : "DuckAssistBot/1.2; (+http://duckduckgo.com/duckassistbot.html)", + "expect" : + { + "name" : "DuckAssistBot", + "version" : "1.2", + "type" : "fetcher" + } + }, + { + "desc" : "Google FeedFetcher", + "ua" : "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)", + "expect" : + { + "name" : "FeedFetcher-Google", + "version" : "undefined", + "type" : "fetcher" + } + }, + { + "desc" : "Google Read Aloud - Mobile agent", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)", + "expect" : + { + "name" : "Google-Read-Aloud", + "version" : "undefined", + "type" : "fetcher" + } + }, + { + "desc" : "Google Read Aloud - Desktop agent", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)", + "expect" : + { + "name" : "Google-Read-Aloud", + "version" : "undefined", + "type" : "fetcher" + } + }, + { + "desc" : "Google Publisher Center", + "ua" : "GoogleProducer; (+https://developers.google.com/search/docs/crawling-indexing/google-producer)", + "expect" : + { + "name" : "GoogleProducer", + "version" : "undefined", + "type" : "fetcher" + } + }, + { + "desc" : "Google Site Verifier", + "ua" : "Mozilla/5.0 (compatible; Google-Site-Verification/1.0)", + "expect" : + { + "name" : "Google-Site-Verification", + "version" : "1.0", + "type" : "fetcher" + } + }, + { + "desc" : "Meta-ExternalFetcher", + "ua" : "meta-externalfetcher/1.1 (+https://developers.facebook.com/docs/sharing/webmasters/crawler)", + "expect" : + { + "name" : "meta-externalfetcher", + "version" : "1.1", + "type" : "fetcher" + } + }, + { + "desc" : "Rogerbot", + "ua" : "Mozilla/5.0 (compatible; rogerBot/1.0; UrlCrawler; http://www.seomoz.org/dp/rogerbot)", + "expect" : + { + "name" : "rogerBot", + "version" : "1.0", + "type" : "fetcher" + } + }, + { + "desc" : "UptimeRobot", + "ua" : "Mozilla/5.0 (compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)", + "expect" : + { + "name" : "UptimeRobot", + "version" : "2.0", + "type" : "fetcher" + } } -] +] \ No newline at end of file diff --git a/test/specs/browser-modules.json b/test/specs/browser-libraries.json similarity index 86% rename from test/specs/browser-modules.json rename to test/specs/browser-libraries.json index 1639a19..8e0eb56 100644 --- a/test/specs/browser-modules.json +++ b/test/specs/browser-libraries.json @@ -6,7 +6,7 @@ { "name" : "Scrapy", "version" : "1.5.0", - "type" : "module" + "type" : "library" } } ] diff --git a/test/specs/device-all.json b/test/specs/device-all.json index 252782c..f0898b9 100644 --- a/test/specs/device-all.json +++ b/test/specs/device-all.json @@ -8,6 +8,33 @@ "type": "mobile" } }, + { + "desc": "Advan M4", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0; ADVAN M4 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Mobile Safari/537.36 OPR/28.0.2254.119214", + "expect": { + "vendor": "ADVAN", + "model": "M4", + "type": "mobile" + } + }, + { + "desc": "Advan S40", + "ua": "Mozilla/5.0 (Linux; Android 7.0; ADVAN S40 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Mobile Safari/537.36 EdgA/79.0.309.58", + "expect": { + "vendor": "ADVAN", + "model": "S40", + "type": "mobile" + } + }, + { + "desc": "Advan Sketsa 2", + "ua": "Mozilla/5.0 (Linux; Android 11; ADVAN 1011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.101 Safari/537.36", + "expect": { + "vendor": "ADVAN", + "model": "1011", + "type": "mobile" + } + }, { "desc": "ASUS Nexus 7", "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 7 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36", @@ -215,6 +242,42 @@ "type": "mobile" } }, + { + "desc": "Cat B15Q", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; B15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36", + "expect": { + "vendor": "Cat", + "model": "B15Q", + "type": "mobile" + } + }, + { + "desc": "Cat B35", + "ua": "Mozilla/5.0 (Mobile; CAT B35; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5.1", + "expect": { + "vendor": "Cat", + "model": "B35", + "type": "mobile" + } + }, + { + "desc": "Cat S22 Flip", + "ua": "Mozilla/5.0 (Linux; Android 11; S22 FLIP Build/RKQ1.210416.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.165 Mobile Safari/537.36", + "expect": { + "vendor": "Cat", + "model": "S22 FLIP", + "type": "mobile" + } + }, + { + "desc": "Cat S62 Pro", + "ua": "Mozilla/5.0 (Linux; Android 11; S62 Pro Build/RKQ1.210406.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/94.0.4606.85 Mobile Safari/537.36 GSA/12.34.17.23.arm64", + "expect": { + "vendor": "Cat", + "model": "S62 Pro", + "type": "mobile" + } + }, { "desc": "Desktop (IE11 with Tablet string)", "ua": "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; GWX:MANAGED; rv:11.0) like Gecko", @@ -233,6 +296,33 @@ "type": "mobile" } }, + { + "desc": "Energizer Energy 400", + "ua": "Mozilla/5.0 (Linux; Android 6.0; Energy400 Build/MRA58K test-keys; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/172.0.0.66.93;]", + "expect": { + "vendor": "Energizer", + "model": "Energy400", + "type": "mobile" + } + }, + { + "desc": "Energizer Energy 400S", + "ua": "Mozilla/5.0 (Linux; Android 6.0; Energy 400S Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.85 Mobile Safari/537.36", + "expect": { + "vendor": "Energizer", + "model": "Energy 400S", + "type": "mobile" + } + }, + { + "desc": "Energizer Ultimate 65G", + "ua": "Mozilla/5.0 (Linux; Android 14; Energizer Ultimate 65G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "Energizer", + "model": "Ultimate 65G", + "type": "mobile" + } + }, { "desc": "Fairphone 1U", "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; FP1U Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", @@ -669,7 +759,7 @@ "desc": "Huawei Honor 6A", "ua": "Mozilla/5.0 (Linux; Android 7.0; DLI-L22 Build/HONORDLI-L22; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/252.0.0.22.355;]", "expect": { - "vendor": "Huawei", + "vendor": "Honor", "model": "DLI-L22", "type": "mobile" } @@ -678,7 +768,7 @@ "desc": "Huawei Honor 7", "ua": "Mozilla/5.0 (Linux; Android 6.0; PLK-L01 Build/HONORPLK-L01; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36", "expect": { - "vendor": "Huawei", + "vendor": "Honor", "model": "PLK-L01", "type": "mobile" } @@ -687,7 +777,7 @@ "desc": "Huawei 10 Lite", "ua": "Mozilla/5.0 (Linux; Android 9; HRY-LX1 Build/HONORHRY-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36", "expect": { - "vendor": "Huawei", + "vendor": "Honor", "model": "HRY-LX1", "type": "mobile" } @@ -782,6 +872,42 @@ "type": "mobile" } }, + { + "desc": "IMO FEEL A2", + "ua": "Mozilla/5.0 (Linux; Android 5.1; IMO FEEL A2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/49.0.2623.105 Mobile Safari/537.36", + "expect": { + "vendor": "IMO", + "model": "FEEL A2", + "type": "mobile" + } + }, + { + "desc": "IMO Q2", + "ua": "Mozilla/5.0 (Linux; Android 5.1; IMO Q2 Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 GSA/7.22.24.21.arm", + "expect": { + "vendor": "IMO", + "model": "Q2", + "type": "mobile" + } + }, + { + "desc": "IMO S2", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; IMO S2 Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.162 Mobile Safari/537.36", + "expect": { + "vendor": "IMO", + "model": "S2", + "type": "mobile" + } + }, + { + "desc": "IMO Tab X9", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; id-id; IMO TAB X9 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "IMO", + "model": "TAB X9", + "type": "tablet" + } + }, { "desc": "Infinix Hot 7 Pro", "ua": "Mozilla/5.0 (Linux; Android 9; Infinix X625C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36", @@ -1151,6 +1277,33 @@ "type": "mobile" } }, + { + "desc": "Micromax Bharat 2 Plus", + "ua": "Mozilla/5.0 (Linux; U; Android 7.0; en-US; Micromax Q402Plus Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.12.9.1226 Mobile Safari/537.36", + "expect": { + "vendor": "Micromax", + "model": "Q402Plus", + "type": "mobile" + } + }, + { + "desc": "Micromax Canvas Infinity", + "ua": "Mozilla/5.0 (Linux; U; Android 7.1.2; en-US; Micromax HS2 Build/N2G47H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/13.2.0.1296 (SpeedMode) U4/1.0 UCWEB/2.0 Mobile Safari/534.30", + "expect": { + "vendor": "Micromax", + "model": "HS2", + "type": "mobile" + } + }, + { + "desc": "Micromax In 1b", + "ua": "Mozilla/5.0 (Linux; U; Android 10; Micromax E7533 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.101 Mobile Safari/537.36 OPR/54.0.2254.56148", + "expect": { + "vendor": "Micromax", + "model": "E7533", + "type": "mobile" + } + }, { "desc": "Microsoft Lumia 950", "ua": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586", @@ -1286,6 +1439,60 @@ "type": "mobile" } }, + { + "desc": "itel A25", + "ua": "Mozilla/5.0 (Linux; Android 9; itel L5002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.130 Mobile Safari/537.36 OPR/63.3.3216.58675", + "expect": { + "vendor": "itel", + "model": "L5002", + "type": "mobile" + } + }, + { + "desc": "itel A50", + "ua": "Mozilla/5.0 (Linux; U; Android 14; itel A667L Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/127.0.6533.103 Mobile Safari/537.36 OPR/83.1.2254.73239", + "expect": { + "vendor": "itel", + "model": "A667L", + "type": "mobile" + } + }, + { + "desc": "itel KidPad 1", + "ua": "Mozilla/5.0 (Linux; Android 10; Itel W7001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.101 Mobile Safari/537.36", + "expect": { + "vendor": "itel", + "model": "W7001", + "type": "tablet" + } + }, + { + "desc": "itel Pad One", + "ua": "Mozilla/5.0 (Linux; Android 12; itel P10001L Build/SP1A.210812.016) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.172 Safari/537.36", + "expect": { + "vendor": "itel", + "model": "P10001L", + "type": "tablet" + } + }, + { + "desc": "itel RS4", + "ua": "Mozilla/5.0 (Linux; Android 13; itel S666LN Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/468.1.0.56.78;]", + "expect": { + "vendor": "itel", + "model": "S666LN", + "type": "mobile" + } + }, + { + "desc": "itel Vision 2S", + "ua": "Mozilla/5.0 (Linux; Android 11; itel P651L Build/RP1A.201005.001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.76 Mobile Safari/537.36", + "expect": { + "vendor": "itel", + "model": "P651L", + "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", @@ -1367,6 +1574,33 @@ "type": "mobile" } }, + { + "desc": "Nothing 1", + "ua": "Mozilla/5.0 (Linux; Android 13; A063) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/22.0 Chrome/111.0.5563.116 Mobile Safari/537.36", + "expect": { + "vendor": "Nothing", + "model": "A063", + "type": "mobile" + } + }, + { + "desc": "Nothing 2", + "ua": "Mozilla/5.0 (Linux; Android 14; A065 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.53 Mobile Safari/537.36", + "expect": { + "vendor": "Nothing", + "model": "A065", + "type": "mobile" + } + }, + { + "desc": "Nothing 2a", + "ua": "Mozilla/5.0 (Linux; Android 14; A142 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.71 Mobile Safari/537.36", + "expect": { + "vendor": "Nothing", + "model": "A142", + "type": "mobile" + } + }, { "desc": "Oculus Quest", "ua": "Mozilla/5.0 (Linux; Android 10; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36", @@ -1403,6 +1637,15 @@ "type": "xr" } }, + { + "desc": "Issue #747", + "ua": "python-requests/2.25.1", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "undefined" + } + }, { "desc": "OnePlus One", "ua": "Mozilla/5.0 (Linux; Android 4.4.4; A0001 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.59 Mobile Safari/537.36", @@ -1790,6 +2033,69 @@ "type": "smarttv" } }, + { + "desc": "Pico 4", + "ua": "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.8.2 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.38 Chrome/105.0.5195.68 VR Safari/537.36", + "expect": { + "vendor": "PICO", + "model": "4", + "type": "xr" + } + }, + { + "desc": "Pico 4", + "ua": "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36 OculusBrowser/7.0", + "expect": { + "vendor": "PICO", + "model": "4", + "type": "xr" + } + }, + { + "desc": "Pico Neo3 Link", + "ua": "Mozilla/5.0 (X11; Linux x86_64; Pico Neo3 Link OS5.8.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36", + "expect": { + "vendor": "Pico", + "model": "Neo3 Link", + "type": "xr" + } + }, + { + "desc": "Polytron Prime 7 Pro", + "ua": "Mozilla/5.0 (Linux; U; Android 7.0; POLYTRON_P552 Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/64.0.3282.137 Mobile Safari/537.36 OPR/50.0.2254.149182", + "expect": { + "vendor": "POLYTRON", + "model": "P552", + "type": "mobile" + } + }, + { + "desc": "Polytron Rocket T1", + "ua": "Mozilla/5.0 (Linux; U; Android 5.0; en-US; POLYTRON R2501 Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/13.1.2.1293 Mobile Safari/537.36", + "expect": { + "vendor": "POLYTRON", + "model": "R2501", + "type": "mobile" + } + }, + { + "desc": "Polytron Rocket T6", + "ua": "Mozilla/5.0 (Linux; Android 7.0; POLYTRON R2509) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.92 Mobile Safari/537.36", + "expect": { + "vendor": "POLYTRON", + "model": "R2509", + "type": "mobile" + } + }, + { + "desc": "Polytron Zap 6 Posh", + "ua": "Mozilla/5.0 (Linux; U; Android 5.1; in-ID; POLYTRON_4G501 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.10.0.1163 UCTurbo/1.9.9.900 Mobile Safari/537.36", + "expect": { + "vendor": "POLYTRON", + "model": "4G501", + "type": "mobile" + } + }, { "desc": "Roku", "ua": "Mozilla/5.0 (Roku) AppleWebKit/537.36 (KHTML, like Gecko) Web/1.1 Safari/537.36", @@ -1862,6 +2168,24 @@ "type": "tablet" } }, + { + "desc": "Echo Show 8", + "ua": "Mozilla/5.0 (Linux; Android 7.1.2; AEOCW) AppleWebKit/537.36 (KHTML, like Gecko) Silk/106.3.3 like Chrome/106.0.5249.170 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "AEOCW", + "type": "tablet" + } + }, + { + "desc": "Echo Show 15", + "ua": "Mozilla/5.0 (Linux; Android 9; AEOHY) AppleWebKit/537.36 (KHTML, like Gecko) Silk/112.6.3 like Chrome/112.0.5615.213 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "AEOHY", + "type": "tablet" + } + }, { "desc": "Echo Dot", "ua": "Dalvik/2.1.0 (Linux; U; Android 5.1.1; AEOBC Build/LVY48F)", @@ -2078,6 +2402,42 @@ "type": "tablet" } }, + { + "desc": "Samsung Galaxy Watch", + "ua": "Mozilla/5.0 (Linux; Tizen 5.5; SAMSUNG SM-R805W) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.0 Chrome/69.0.3497.106 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-R805W", + "type": "wearable" + } + }, + { + "desc": "Samsung Galaxy Watch Active 2", + "ua": "Mozilla/5.0 (Linux; Tizen 5.5; SAMSUNG SM-R820) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.0 Chrome/69.0.3497.106 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-R820", + "type": "wearable" + } + }, + { + "desc": "Samsung Galaxy Watch4", + "ua": "Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-R875U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.2. Chrome/102.0.5005.125 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-R875U", + "type": "wearable" + } + }, + { + "desc": "Samsung Galaxy Watch5 Pro", + "ua": "Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-R925U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2. Chrome/111.0.5563.116 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-R925U", + "type": "wearable" + } + }, { "desc": "Samsung Note 10.1", "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SM-P605) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36", @@ -2186,6 +2546,33 @@ "type": "mobile" } }, + { + "desc": "Smartfren Andromax L", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Andromax B26D2H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36", + "expect": { + "vendor": "Smartfren", + "model": "Andromax B26D2H", + "type": "mobile" + } + }, + { + "desc": "Smartfren Andromax G2", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Smartfren Andromax AD9A1H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.83 Mobile Safari/537.36", + "expect": { + "vendor": "Smartfren", + "model": "Andromax AD9A1H", + "type": "mobile" + } + }, + { + "desc": "Smartfren New Andromax I", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; id-id; New Andromax-i Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Smartfren", + "model": "New Andromax-i", + "type": "mobile" + } + }, { "desc": "SONY Xperia 1 III", "ua": "Mozilla/5.0 (Linux; Android 11; A101SO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Mobile Safari/537.36", @@ -2366,6 +2753,483 @@ "type": "smarttv" } }, + { + "desc": "TCL 10 5G", + "ua": "Mozilla/5.0 (Linux; Android 11; T790Y) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36 EdgA/114.0.1823.43", + "expect": { + "vendor": "TCL", + "model": "T790Y", + "type": "mobile" + } + }, + { + "desc": "TCL 10 5G UW", + "ua": "Mozilla/5.0 (Linux; Android 10; T790S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T790S", + "type": "mobile" + } + }, + { + "desc": "TCL 10 Plus", + "ua": "Mozilla/5.0 (Linux; Android 11; T782H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Mobile Safari/537.36 OPR/64.3.3282.60839", + "expect": { + "vendor": "TCL", + "model": "T782H", + "type": "mobile" + } + }, + { + "desc": "TCL 10 Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; T799B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T799B", + "type": "mobile" + } + }, + { + "desc": "TCL 10 SE", + "ua": "Mozilla/5.0 (Linux; Android 10; T766H_RU) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T766H", + "type": "mobile" + } + }, + { + "desc": "TCL 10 TabMax", + "ua": "Mozilla/5.0 (Linux; Android 11; 9296Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9296Q", + "type": "tablet" + } + }, + { + "desc": "TCL 10 TabMax 4G", + "ua": "Mozilla/5.0 (Linux; Android 10; 9295G_EEA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9295G", + "type": "tablet" + } + }, + { + "desc": "TCL 10 TabMax WiFi", + "ua": "Mozilla/5.0 (Linux; Android 10; 9296G_TR) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.101 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9296G", + "type": "tablet" + } + }, + { + "desc": "TCL 10L", + "ua": "Mozilla/5.0 (Linux; Android 10; T770B Build/QKQ1.200329.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.141 Mobile Safari/537.36 GSA/11.41.10.23.arm64", + "expect": { + "vendor": "TCL", + "model": "T770B", + "type": "mobile" + } + }, + { + "desc": "TCL 10L", + "ua": "Mozilla/5.0 (Linux; Android 11; T770H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T770H", + "type": "mobile" + } + }, + { + "desc": "TCL 20 5G", + "ua": "Mozilla/5.0 (Linux; Android 11; T781) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T781", + "type": "mobile" + } + }, + { + "desc": "TCL 20 Pro 5G", + "ua": "Mozilla/5.0 (Linux; Android 12; T810S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36 EdgA/113.0.1774.63", + "expect": { + "vendor": "TCL", + "model": "T810S", + "type": "mobile" + } + }, + { + "desc": "TCL 20 SE", + "ua": "Mozilla/5.0 (Linux; Android 11; T671H Build/RKQ1.201112.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.73 Mobile Safari/537.36 GoogleApp/13.9.7.23.arm64", + "expect": { + "vendor": "TCL", + "model": "T671H", + "type": "mobile" + } + }, + { + "desc": "TCL 20 XE", + "ua": "Mozilla/5.0 (Linux; Android 11; 5087Z) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "5087Z", + "type": "mobile" + } + }, + { + "desc": "TCL 20B", + "ua": "Mozilla/5.0 (Linux; Android 11; 6159K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "6159K", + "type": "mobile" + } + }, + { + "desc": "TCL 205", + "ua": "Mozilla/5.0 (Linux; Android 11; 4187D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "4187D", + "type": "mobile" + } + }, + { + "desc": "TCL 20E", + "ua": "Mozilla/5.0 (Linux; Android 11; 6125A) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/18.0 Chrome/99.0.4844.88 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "6125A", + "type": "mobile" + } + }, + { + "desc": "TCL 20L", + "ua": "Mozilla/5.0 (Linux; Android 11; T774H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.59 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T774H", + "type": "mobile" + } + }, + { + "desc": "TCL 20L Plus", + "ua": "Mozilla/5.0 (Linux; Android 11; T775H Build/RKQ1.210107.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.61 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T775H", + "type": "mobile" + } + }, + { + "desc": "TCL 20R 5G", + "ua": "Mozilla/5.0 (Linux; Android 11; T767H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36 OPR/71.3.3718.67322", + "expect": { + "vendor": "TCL", + "model": "T767H", + "type": "mobile" + } + }, + { + "desc": "TCL 20S", + "ua": "Mozilla/5.0 (Linux; Android 11; T773O) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T773O", + "type": "mobile" + } + }, + { + "desc": "TCL 20Y", + "ua": "Mozilla/5.0 (Linux; Android 11; 6156D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.134 Mobile Safari/537.36 OPR/70.3.3653.66287", + "expect": { + "vendor": "TCL", + "model": "6156D", + "type": "mobile" + } + }, + { + "desc": "TCL 30 V 5G", + "ua": "Mozilla/5.0 (Linux; Android 11; T781S Build/RKQ1.210614.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.166 Mobile Safari/537.36[FBAN/EMA;FBLC/en_US;FBAV/369.0.0.5.110;]", + "expect": { + "vendor": "TCL", + "model": "T781S", + "type": "mobile" + } + }, + { + "desc": "TCL 30 XE 5G", + "ua": "Mozilla/5.0 (Linux; Android 12; T767W Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.162 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/416.0.0.35.85;]", + "expect": { + "vendor": "TCL", + "model": "T767W", + "type": "mobile" + } + }, + { + "desc": "TCL 305", + "ua": "Mozilla/5.0 (Linux; arm; Android 11; 6102D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.167 YaBrowser/22.7.6.96.00 SA/3 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "6102D", + "type": "mobile" + } + }, + { + "desc": "TCL 306", + "ua": "Mozilla/5.0 (Linux; Android 12; 6102H Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.141 Mobile Safari/537.36[FBAN/EMA;FBLC/it_IT;FBAV/332.0.0.22.108;]", + "expect": { + "vendor": "TCL", + "model": "6102H", + "type": "mobile" + } + }, + { + "desc": "TCL 30", + "ua": "Mozilla/5.0 (Linux; Android 12; T676H Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.162 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T676H", + "type": "mobile" + } + }, + { + "desc": "TCL 30+", + "ua": "Mozilla/5.0 (Linux; Android 12; T676J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T676J", + "type": "mobile" + } + }, + { + "desc": "TCL 30 5G", + "ua": "Mozilla/5.0 (Linux; Android 12; T776H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T776H", + "type": "mobile" + } + }, + { + "desc": "TCL 30 LE", + "ua": "Mozilla/5.0 (Linux; Android 12; 4188V Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.136 Mobile Safari/537.36[FBAN/EMA;FBLC/en_US;FBAV/352.0.0.14.108;]", + "expect": { + "vendor": "TCL", + "model": "4188V", + "type": "mobile" + } + }, + { + "desc": "TCL 30 SE", + "ua": "Mozilla/5.0 (Linux; Android 12; 6165H Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/108.0.5359.128 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/396.1.0.28.104;]", + "expect": { + "vendor": "TCL", + "model": "6165H", + "type": "mobile" + } + }, + { + "desc": "TCL 30E", + "ua": "Mozilla/5.0 (Linux; Android 12; 6127I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "6127I", + "type": "mobile" + } + }, + { + "desc": "TCL 40 NxtPaper", + "ua": "Mozilla/5.0 (Linux; Android 13; T612B Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.53 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T612B", + "type": "mobile" + } + }, + { + "desc": "TCL A3", + "ua": "Mozilla/5.0 (Linux; Android 11; A509DL Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/101.0.4951.61 Mobile Safari/537.36 GSA/13.18.7.23.arm64", + "expect": { + "vendor": "TCL", + "model": "A509DL", + "type": "mobile" + } + }, + { + "desc": "TCL A30", + "ua": "Mozilla/5.0 (Linux; Android 11; 5102L Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.136 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/413.0.0.30.104;]", + "expect": { + "vendor": "TCL", + "model": "5102L", + "type": "mobile" + } + }, + { + "desc": "TCL 40 SE", + "ua": "Mozilla/5.0 (Linux; Android 13; T610K Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.166 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T610K", + "type": "mobile" + } + }, + { + "desc": "TCL 40 XE 5G", + "ua": "Mozilla/5.0 (Linux; Android 13; T609DL Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.136 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/466.1.0.57.85;]", + "expect": { + "vendor": "TCL", + "model": "T609DL", + "type": "mobile" + } + }, + { + "desc": "TCL 403", + "ua": "Mozilla/5.0 (Linux; Android 12; T431D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T431D", + "type": "mobile" + } + }, + { + "desc": "TCL 405", + "ua": "Mozilla/5.0 (Linux; Android 12; T506D Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.162 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/418.0.0.33.69;]", + "expect": { + "vendor": "TCL", + "model": "T506D", + "type": "mobile" + } + }, + { + "desc": "TCL 408", + "ua": "Mozilla/5.0 (Linux; U; Android 12; T507U Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/105.0.5195.136 Mobile Safari/537.36 OPR/75.0.2254.68857", + "expect": { + "vendor": "TCL", + "model": "T507U", + "type": "mobile" + } + }, + { + "desc": "TCL 40R 5G", + "ua": "Mozilla/5.0 (Linux; Android 12; T771K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36 EdgA/114.0.1823.37", + "expect": { + "vendor": "TCL", + "model": "T771K", + "type": "mobile" + } + }, + { + "desc": "TCL Ion X", + "ua": "Mozilla/5.0 (Linux; Android 12; T430W Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.60 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T430W", + "type": "mobile" + } + }, + { + "desc": "TCL NxtPaper 11", + "ua": "Mozilla/5.0 (Linux; Android 13; 9466X Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.179 Safari/537.36 [FB_IAB/FB4A;FBAV/473.0.0.41.81;]", + "expect": { + "vendor": "TCL", + "model": "9466X", + "type": "tablet" + } + }, + { + "desc": "TCL Stylus 5G", + "ua": "Mozilla/5.0 (Linux; Android 12; T779W Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/127.0.6533.2 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "T779W", + "type": "mobile" + } + }, + { + "desc": "TCL Tab 8 4G", + "ua": "Mozilla/5.0 (Linux; Android 10; 9048S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9048S", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 8 LE", + "ua": "Mozilla/5.0 (Linux; Android 12; 9137W Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.61 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9137W", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10 FHD 4G", + "ua": "Mozilla/5.0 (Linux; Android 11; 9060G Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.196 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9060G", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10 HD 4G", + "ua": "Mozilla/5.0 (Linux; Android 11; 9060X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9060X", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10 LTE", + "ua": "Mozilla/5.0 (Linux; Android 13; 8196G Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.162 Safari/537.36 [FB_IAB/FB4A;FBAV/471.0.0.35.80;]", + "expect": { + "vendor": "TCL", + "model": "8196G", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10 WiFi", + "ua": "Mozilla/5.0 (Linux; Android 13; 8496G Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/127.0.6533.61 Safari/537.36 [FB_IAB/FB4A;FBAV/474.0.0.52.74;]", + "expect": { + "vendor": "TCL", + "model": "8496G", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10L", + "ua": "Mozilla/5.0 (Linux; Android 11; 8491X_EEA Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.105 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "8491X", + "type": "tablet" + } + }, + { + "desc": "TCL Tab 10s 4G", + "ua": "Mozilla/5.0 (Linux; Android 11; 9080G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "9080G", + "type": "tablet" + } + }, + { + "desc": "TCL Xess P17AA", + "ua": "Mozilla/5.0 (Linux; Android 5.1; TCL Xess P17AA Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Safari/537.36", + "expect": { + "vendor": "TCL", + "model": "Xess P17AA", + "type": "tablet" + } + }, { "desc": "Tecno KC8", "ua": "Mozilla/5.0 (Linux; Android 10; TECNO KC8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36", @@ -2591,6 +3455,15 @@ "type": "mobile" } }, + { + "desc": "Xiaomi Mi 10 Pro", + "ua": "Linux; U; Android 13; Mi 10 Pro Build/TKQ1.221114.001", + "expect": { + "vendor": "Xiaomi", + "model": "Mi 10 Pro", + "type": "mobile" + } + }, { "desc": "Xiaomi Mi 5s Plus", "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; zh-cn; MI 5s Plus Build/MXB48T) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.146 Mobile Safari/537.36 XiaoMi/MiuiBrowser/8.7.1", @@ -3023,6 +3896,42 @@ "type": "mobile" } }, + { + "desc": "Google Chromecast with Google TV", + "ua": "Mozilla/5.0 (Linux; Android 12.0; Build/STTL.240206.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.0 Safari/537.36 CrKey/1.56.500000 DeviceType/AndroidTV", + "expect": { + "vendor": "Google", + "model": "Chromecast AndroidTV", + "type": "smarttv" + } + }, + { + "desc": "Google Chromecast Mini Smart Speaker", + "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.225 Safari/537.36 CrKey/1.56.500000 DeviceType/SmartSpeaker", + "expect": { + "vendor": "Google", + "model": "Chromecast SmartSpeaker", + "type": "smarttv" + } + }, + { + "desc": "Google Chromecast Third Generation", + "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.225 Safari/537.36 CrKey/1.56.500000 DeviceType/Chromecast", + "expect": { + "vendor": "Google", + "model": "Chromecast Third Generation", + "type": "smarttv" + } + }, + { + "desc": "Google Chromecast Nest Hub", + "ua": "Mozilla/5.0 (Fuchsia) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 CrKey/1.56.500000", + "expect": { + "vendor": "Google", + "model": "Chromecast Nest Hub", + "type": "smarttv" + } + }, { "desc": "Google Chromecast", "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.84 Safari/537.36 CrKey/1.22.79313", diff --git a/test/specs/engine-all.json b/test/specs/engine-all.json index e75e539..7523fc3 100644 --- a/test/specs/engine-all.json +++ b/test/specs/engine-all.json @@ -1,4 +1,13 @@ [ + { + "desc" : "ArkWeb", + "ua" : "Mozilla/5.0 (Phone; OpenHarmony 4.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile", + "expect" : + { + "name" : "ArkWeb", + "version" : "4.1.6.1" + } + }, { "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", @@ -80,6 +89,15 @@ "version" : "2.8.149" } }, + { + "desc" : "Servo", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Servo/1.0 Firefox/111.0", + "expect" : + { + "name" : "Servo", + "version" : "1.0" + } + }, { "desc" : "Tasman", "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)", diff --git a/test/specs/os-all.json b/test/specs/os-all.json index 9ad108c..b93dc33 100644 --- a/test/specs/os-all.json +++ b/test/specs/os-all.json @@ -414,11 +414,38 @@ } }, { - "desc" : "Google Chromecast", + "desc" : "Google Chromecast with Google TV", + "ua" : "Mozilla/5.0 (Linux; Android 12.0; Build/STTL.240206.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.0 Safari/537.36 CrKey/1.56.500000 DeviceType/AndroidTV", + "expect" : + { + "name" : "Chromecast Android", + "version" : "12.0" + } + }, + { + "desc" : "Google Chromecast Nest Hub", + "ua" : "Mozilla/5.0 (Fuchsia) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 CrKey/1.56.500000", + "expect" : + { + "name" : "Chromecast Fuchsia", + "version" : "1.56.500000" + } + }, + { + "desc" : "Google Chromecast Mini Smart Speaker", + "ua" : "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.225 Safari/537.36 CrKey/1.56.500000 DeviceType/SmartSpeaker", + "expect" : + { + "name" : "Chromecast SmartSpeaker", + "version" : "1.56.500000" + } + }, + { + "desc" : "Google Chromecast Legacy Linux-Based", "ua" : "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786", "expect" : { - "name" : "Chromecast", + "name" : "Chromecast Linux", "version" : "1.42.183786" } }, @@ -440,6 +467,39 @@ "version" : "4" } }, + { + "desc" : "PlayStation 5", + "ua" : "Mozilla/5.0 (PlayStation 5/SmartTV) AppleWebKit/605.1.15 (KHTML, like Gecko)", + "expect" : + { + "name" : "PlayStation", + "version" : "5" + } + }, + { + "desc": "Pico 4", + "ua": "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.8.2 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.38 Chrome/105.0.5195.68 VR Safari/537.36", + "expect": { + "name" : "PICO", + "version" : "5.8.2" + } + }, + { + "desc": "Pico 4", + "ua": "Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36 OculusBrowser/7.0", + "expect": { + "name" : "PICO", + "version" : "5.4.0" + } + }, + { + "desc": "Pico Neo3 Link", + "ua": "Mozilla/5.0 (X11; Linux x86_64; Pico Neo3 Link OS5.8.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36", + "expect": { + "name" : "Pico", + "version" : "5.8.4.0" + } + }, { "desc" : "Xbox 360", "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox 360) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", @@ -476,6 +536,15 @@ "version" : "Series X" } }, + { + "desc" : "Xbox Series S", + "ua" : "Mozilla/5.0 (Compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Xbox; Xbox Series S)", + "expect" : + { + "name" : "Xbox", + "version" : "Series S" + } + }, { "desc" : "Mint", "ua" : "Opera/9.80 (X11; Linux x86_64; Edition Linux Mint) Presto/2.12.388 Version/12.16", @@ -1240,5 +1309,14 @@ "name" : "SerenityOS", "version" : "undefined" } + }, + { + "desc" : "OpenHarmony", + "ua" : "Mozilla/5.0 (Phone; OpenHarmony 4.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile", + "expect" : + { + "name" : "OpenHarmony", + "version" : "4.1" + } } ]