mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-16 23:21:52 +03:00
Compare commits
1 Commits
2.0.0-beta
...
v0.7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a21b0f2294 |
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@@ -1,12 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: faisalman
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: ua-parser-js
|
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
otechie: # Replace with a single Otechie username
|
|
||||||
custom: ['https://www.paypal.me/faisalman/']
|
|
||||||
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Library version**
|
|
||||||
Which version of the library that you use, eg: v0.7.35 or v2.0.0-alpha.3
|
|
||||||
|
|
||||||
For the issue related with detection result, you can use the demo section in https://uaparser.js.org to confirm
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
- [ ] I have read and accept the [Contributor License Agreement (CLA)](https://gist.github.com/faisalman/2ed16621ebb544157eba85a7f7381417) Document and I hereby sign the CLA
|
|
||||||
78
.github/workflows/analysis-codeql.yml
vendored
78
.github/workflows/analysis-codeql.yml
vendored
@@ -1,78 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: CodeQL Analysis
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master"]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ "master" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '15 6 * * 0'
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: [ 'javascript' ]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
||||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
|
||||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v2
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
# - name: Autobuild
|
|
||||||
# uses: github/codeql-action/autobuild@v2
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
||||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
||||||
|
|
||||||
# - run: |
|
|
||||||
# echo "Run, Build Application using script"
|
|
||||||
# ./location_of_script_within_repo/buildscript.sh
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v2
|
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
||||||
20
.github/workflows/analysis-dependency.yml
vendored
20
.github/workflows/analysis-dependency.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
# Dependency Review Action
|
|
||||||
#
|
|
||||||
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
|
|
||||||
#
|
|
||||||
# Source repository: https://github.com/actions/dependency-review-action
|
|
||||||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
|
||||||
name: Dependency Analysis
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
dependency-review:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Checkout Repository'
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: 'Dependency Review'
|
|
||||||
uses: actions/dependency-review-action@v2
|
|
||||||
72
.github/workflows/analysis-scorecard.yml
vendored
72
.github/workflows/analysis-scorecard.yml
vendored
@@ -1,72 +0,0 @@
|
|||||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
|
||||||
# by a third-party and are governed by separate terms of service, privacy
|
|
||||||
# policy, and support documentation.
|
|
||||||
|
|
||||||
name: OpenSSF's Scorecard Analysis
|
|
||||||
on:
|
|
||||||
# For Branch-Protection check. Only the default branch is supported. See
|
|
||||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
|
||||||
branch_protection_rule:
|
|
||||||
# To guarantee Maintained check is occasionally updated. See
|
|
||||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
|
||||||
schedule:
|
|
||||||
- cron: '45 2 * * 4'
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
# Declare default permissions as read only.
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analysis:
|
|
||||||
name: Scorecard analysis
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
# Needed to upload the results to code-scanning dashboard.
|
|
||||||
security-events: write
|
|
||||||
# Needed to publish results and get a badge (see publish_results below).
|
|
||||||
id-token: write
|
|
||||||
# Uncomment the permissions below if installing in a private repository.
|
|
||||||
# contents: read
|
|
||||||
# actions: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Checkout code"
|
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: "Run analysis"
|
|
||||||
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
|
|
||||||
with:
|
|
||||||
results_file: results.sarif
|
|
||||||
results_format: sarif
|
|
||||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
|
||||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
|
||||||
# - you are installing Scorecard on a *private* repository
|
|
||||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
|
|
||||||
repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
|
||||||
|
|
||||||
# Public repositories:
|
|
||||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
|
||||||
# - Allows the repository to include the Scorecard badge.
|
|
||||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
|
||||||
# For private repositories:
|
|
||||||
# - `publish_results` will always be set to `false`, regardless
|
|
||||||
# of the value entered here.
|
|
||||||
publish_results: true
|
|
||||||
|
|
||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
|
||||||
# format to the repository Actions tab.
|
|
||||||
- name: "Upload artifact"
|
|
||||||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
|
|
||||||
with:
|
|
||||||
name: SARIF file
|
|
||||||
path: results.sarif
|
|
||||||
retention-days: 5
|
|
||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
|
||||||
- name: "Upload to code-scanning"
|
|
||||||
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
|
|
||||||
with:
|
|
||||||
sarif_file: results.sarif
|
|
||||||
22
.github/workflows/publish-github-packages.yml
vendored
22
.github/workflows/publish-github-packages.yml
vendored
@@ -1,22 +0,0 @@
|
|||||||
name: Publish to GitHub Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '18.x'
|
|
||||||
registry-url: https://npm.pkg.github.com/
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm publish
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
23
.github/workflows/publish-npm-packages.yml
vendored
23
.github/workflows/publish-npm-packages.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: Publish to NPM
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '18.x'
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
- run: npm install -g npm
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm publish --provenance --access public
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
23
.github/workflows/test-ci.yml
vendored
23
.github/workflows/test-ci.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: UAParser.js CI-Test
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run-test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch: [amd64, ppc64le]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
- name: Run the test
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npx playwright install
|
|
||||||
npm test
|
|
||||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,20 +1,12 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
playwright-report/
|
<<<<<<< HEAD
|
||||||
test-results/
|
|
||||||
|
|
||||||
### vim ###
|
### vim ###
|
||||||
.*.s[a-w][a-z]
|
.*.s[a-w][a-z]
|
||||||
*.un~
|
*.un~
|
||||||
Session.vim
|
Session.vim
|
||||||
.netrwhist
|
.netrwhist
|
||||||
*~
|
*~
|
||||||
.versions
|
|
||||||
|
|
||||||
### editors ###
|
|
||||||
.vscode
|
|
||||||
.idea
|
|
||||||
*.sublime-*
|
|
||||||
|
|
||||||
### OSX ###
|
### OSX ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@@ -22,9 +14,13 @@ Session.vim
|
|||||||
.LSOverride
|
.LSOverride
|
||||||
Icon
|
Icon
|
||||||
|
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
._*
|
._*
|
||||||
|
|
||||||
# Files that might appear on external disk
|
# Files that might appear on external disk
|
||||||
.Spotlight-V100
|
.Spotlight-V100
|
||||||
.Trashes
|
.Trashes
|
||||||
|
=======
|
||||||
|
.idea
|
||||||
|
>>>>>>> baf4bb99b4ef92c71419931e8fd334e34c051e52
|
||||||
|
|||||||
6
.travis.yml
Normal file
6
.travis.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.8
|
||||||
|
- 0.6
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
134
CHANGELOG.md
134
CHANGELOG.md
@@ -1,134 +0,0 @@
|
|||||||
# UAParser.js Changelog
|
|
||||||
|
|
||||||
# Version 2.0
|
|
||||||
- What's breaking:
|
|
||||||
- Dual-licensed under AGPLv3 or PRO License
|
|
||||||
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
|
|
||||||
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
|
|
||||||
- What's new:
|
|
||||||
- Some new methods in result object:
|
|
||||||
- Support for client hints: `withClientHints()`
|
|
||||||
- Support for feature detection: `withFeatureCheck()`
|
|
||||||
- Utility for easy comparison: `is()`
|
|
||||||
- Utility to print full-name: `toString()`
|
|
||||||
- Support for ES module `import { UAParser } from 'ua-parser-js'`
|
|
||||||
- Provided Enums submodule `'ua-parser-js/enums'`
|
|
||||||
- Provided Extensions submodule `'ua-parser-js/extensions'`
|
|
||||||
- Provided Helpers submodule `'ua-parser-js/helpers'`
|
|
||||||
|
|
||||||
## Version 2.0.0-beta.2
|
|
||||||
|
|
||||||
- Increase UA_MAX_LENGTH to 500
|
|
||||||
- Add TypeScript declaration file in `ua-parser-js/extensions` submodule
|
|
||||||
- Improve TypeScript module resolution
|
|
||||||
- Add new methods in `ua-parser-js/helpers` submodule: `isAppleSilicon()` & `isChromiumBased()`
|
|
||||||
- Fix misidentified WebView token as device model
|
|
||||||
- Add new browser: Alipay, Klarna, Opera GX, Smart Lenovo Browser, Vivo Browser
|
|
||||||
- Rename browser: Avant, Baidu, Samsung Internet, Sogou Explorer, Sogou Mobile, WeChat
|
|
||||||
- Improve client-hints detection: Edge, Xbox
|
|
||||||
|
|
||||||
## Version 2.0.0-beta.1
|
|
||||||
|
|
||||||
- Update Client Hints Form-Factor
|
|
||||||
- Provide in-package type definitions
|
|
||||||
- Add new device: Ulefone
|
|
||||||
- Improve device detection: Realme, Xiaomi Redmi
|
|
||||||
|
|
||||||
## Version 2.0.0-alpha.3
|
|
||||||
|
|
||||||
- Add `withFeatureCheck()` method
|
|
||||||
- Add `isFrozenUA()` method in `ua-parser-js/helpers` submodule
|
|
||||||
- Add `MediaPlayers` & `Modules` in `ua-parser-js/extensions` submodule
|
|
||||||
- Fix issue with ESM import
|
|
||||||
|
|
||||||
## Version 2.0.0-alpha.2
|
|
||||||
|
|
||||||
- Fix browser result always returning Chromium when using withClientHints()
|
|
||||||
- Fix infinite-loop when await-ing withClientHints() in non-client-hints browser
|
|
||||||
|
|
||||||
## Version 2.0.0-alpha.1
|
|
||||||
|
|
||||||
- Initial work on new major version
|
|
||||||
|
|
||||||
|
|
||||||
# Version 0.7 / 1.0
|
|
||||||
|
|
||||||
Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.
|
|
||||||
|
|
||||||
## Version 0.7.37
|
|
||||||
|
|
||||||
- Fix misidentified WebView token as device model
|
|
||||||
- Increase UA_MAX_LENGTH to 500
|
|
||||||
- Add new browser: Alipay, Klarna, Smart Lenovo Browser, Vivo Browser
|
|
||||||
- Add new device: Ulefone
|
|
||||||
- Improve device detection: Realme, Xiaomi Redmi
|
|
||||||
- Rename browser: Avant, Baidu, Samsung Internet, Sogou Explorer, Sogou Mobile, WeChat
|
|
||||||
|
|
||||||
## Version 0.7.36 / 1.0.36
|
|
||||||
- Add new browser: Snapchat
|
|
||||||
- Add new devices: Infinix, Tecno
|
|
||||||
- Improve device detection: Amazon Fire TV, Xiaomi POCO
|
|
||||||
- Improve OS detection: iOS
|
|
||||||
|
|
||||||
## Version 0.7.35 / 1.0.35
|
|
||||||
- Fix result from user-supplied user-agent being altered
|
|
||||||
- Add new browser: Heytap, TikTok
|
|
||||||
- Add new engine: LibWeb
|
|
||||||
- Add new OS: SerenityOS
|
|
||||||
- Improve browser detection: Yandex
|
|
||||||
- Improve device detection: iPhone, Amazon Echo
|
|
||||||
- Improve OS detection: iOS
|
|
||||||
|
|
||||||
## Version 0.7.34 / 1.0.34
|
|
||||||
- Fix Sharp Mobile detected as Huawei Tablet
|
|
||||||
- Fix IE8 bug
|
|
||||||
- Add new devices : Kobo e-Reader, Apple Watch, and some new SmartTV devices
|
|
||||||
- Add new OS : watchOS
|
|
||||||
- Improve browser detection : Kakao, Naver, Brave
|
|
||||||
- Improve device detection : Oculus, iPad
|
|
||||||
- Improve OS detection : Chrome OS
|
|
||||||
- Using navigator.userAgentData as fallback for device.type & os.name
|
|
||||||
|
|
||||||
## Version 0.7.33 / 1.0.33
|
|
||||||
|
|
||||||
- Add new browser : Cobalt
|
|
||||||
- Identify Macintosh as an Apple device
|
|
||||||
- Fix ReDoS vulnerability
|
|
||||||
|
|
||||||
## Version 0.7.32 / 1.0.32
|
|
||||||
|
|
||||||
- Add new browser : DuckDuckGo, Huawei Browser, LinkedIn
|
|
||||||
- Add new OS : HarmonyOS
|
|
||||||
- Add some Huawei models
|
|
||||||
- Add Sharp Aquos TV
|
|
||||||
- Improve detection Xiaomi Mi CC9
|
|
||||||
- Fix Sony Xperia 1 III misidentified as Acer tablet
|
|
||||||
- Fix Detect Sony BRAVIA as SmartTV
|
|
||||||
- Fix Detect Xiaomi Mi TV as SmartTV
|
|
||||||
- Fix Detect Galaxy Tab S8 as tablet
|
|
||||||
- Fix WeGame mistakenly identified as WeChat
|
|
||||||
- Fix included commas in Safari / Mobile Safari version
|
|
||||||
- Increase UA_MAX_LENGTH to 350
|
|
||||||
|
|
||||||
## Version 0.7.31 / 1.0.2
|
|
||||||
|
|
||||||
- Fix OPPO Reno A5 incorrect detection
|
|
||||||
- Fix TypeError Bug
|
|
||||||
- Use AST to extract regexes and verify them with safe-regex
|
|
||||||
|
|
||||||
## Version 0.7.30 / 1.0.1
|
|
||||||
|
|
||||||
- Add new browser : Obigo, UP.Browser, Klar
|
|
||||||
- Add new device : Oculus, Roku
|
|
||||||
- Add new OS: Maemo, HP-UX, Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
|
|
||||||
- Improve detection for Sony Xperia 1ii, LG Android TV, and some more devices
|
|
||||||
- Improve detection for ARM64 CPU
|
|
||||||
- Improve detection for Windows Mobile, Netscape, Mac on PowerPC
|
|
||||||
- Categorize PDA as mobile
|
|
||||||
- Fix Sharp devices misjudged as Huawei
|
|
||||||
- Fix trailing comma for ES3 compatibility
|
|
||||||
- Some code refactor
|
|
||||||
|
|
||||||
# Version 0.8
|
|
||||||
|
|
||||||
Version 0.8 was created by accident. This version is now deprecated and no longer maintained, please update to version 0.7 / 1.0.
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# UAParser.js Code of Conduct
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
Welcome to the UAParser.js community! We're here to collaborate on developing an awesome project. Here are some general guidelines to make our community a great place:
|
|
||||||
|
|
||||||
### 1. Be Kind, Honest, and Respectful
|
|
||||||
|
|
||||||
Always treat others with kindness and respect. We value different opinions and encourage positive communication.
|
|
||||||
|
|
||||||
### 2. Keep Conversations Civil and On-Topic
|
|
||||||
|
|
||||||
Please keep discussions related to the project. If you want to talk about something else, find the right place for it.
|
|
||||||
|
|
||||||
### 3. Mutual Assistance, Appreciation, and Acknowledgement
|
|
||||||
|
|
||||||
Feel free to ask for help, show gratitude for contributions, and make sure to give credit where it's due.
|
|
||||||
|
|
||||||
### 4. Resolving Disagreements
|
|
||||||
|
|
||||||
In the event of a disagreement, we encourage open and respectful dialogue. It's important to remember that it's okay to have differing opinions, and if a common ground can't be reached, we suggest using the 'agree to disagree' approach.
|
|
||||||
|
|
||||||
## Reporting Issues
|
|
||||||
|
|
||||||
If you see any behavior that goes against this code of conduct, report it to [f@faisalman.com](mailto:f@faisalman.com).
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
Together, we can make this project awesome!
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# UAParser.js: How to Contribute
|
|
||||||
|
|
||||||
* Fork and clone this repository
|
|
||||||
* Make some changes as required
|
|
||||||
* Write unit test to showcase its functionality under `/test`
|
|
||||||
* Run the test suites to make sure it's not breaking anything `$ npm run build+test`
|
|
||||||
* Submit a pull request under `develop` branch & check the CLA in the submission form
|
|
||||||
73
LICENSE.md
73
LICENSE.md
@@ -1,73 +0,0 @@
|
|||||||
# UAPARSER.JS PRO PERSONAL LICENSE
|
|
||||||
|
|
||||||
Version 1, October 2023
|
|
||||||
|
|
||||||
Copyright (C) 2023 Faisal Salman <f+ua-parser-js@faisalman.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Definitions
|
|
||||||
|
|
||||||
"We" are the team behind UAParser.js.
|
|
||||||
|
|
||||||
"You" are the individual who is responsible for purchasing this license.
|
|
||||||
|
|
||||||
"The Code" is UAParser.js.
|
|
||||||
|
|
||||||
"Project" is what you built with The Code.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
We retains all title, intellectual property, and ownership rights to The Code.
|
|
||||||
|
|
||||||
The Code is licensed, not sold, to You for use solely subject to the terms and conditions detailed here.
|
|
||||||
|
|
||||||
We grant you (and only you) a personal, limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code.
|
|
||||||
|
|
||||||
This license is only valid for You as 1 (one) individual and can not be transferred to other individual or organization.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Rights
|
|
||||||
|
|
||||||
You may use and modify The Code to create as many personal, hobby, educational, and other non-profit use as you want for yourself.
|
|
||||||
|
|
||||||
You may create any number of copies of The Code for yourself.
|
|
||||||
|
|
||||||
You have the right to get lifetime updates and a 1 (one) year support, starting from the time you make the purchase.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Restriction
|
|
||||||
|
|
||||||
You may not use and modify The Code in such a way that may be used directly for commercial purpose.
|
|
||||||
|
|
||||||
You may not redistribute The Code, as-is or modified, except as a part of a Project that you made for yourself.
|
|
||||||
|
|
||||||
You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purpose to the general public, except with our written consent.
|
|
||||||
|
|
||||||
You may not use The Code for unlawful, inappropriate, illegal, or offensive purposes.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
The Code is provided 'as is' without warranty of any kind, expressed, or implied.
|
|
||||||
|
|
||||||
We shall not be liable for any damages, including but not limited to, direct, indirect, special, incidental, or consequential damages or losses that occur by the use of The Code.
|
|
||||||
|
|
||||||
We reserve the rights to discontinue the lifetime updates for The Code at any time, with or without notice.
|
|
||||||
|
|
||||||
We offer support only for question within the scope of The Code functionality or related at our sole discretion.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Terminations
|
|
||||||
|
|
||||||
This license works indefinitely but can be revoked at any time if there is a violation to any of the terms.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Prerequisites
|
|
||||||
|
|
||||||
- [ ] I have read and follow the contributing guidelines
|
|
||||||
- [ ] I have read and accept the [Contributor License Agreement (CLA)](https://gist.github.com/faisalman/2ed16621ebb544157eba85a7f7381417) Document and I hereby sign the CLA
|
|
||||||
|
|
||||||
# Type of Change
|
|
||||||
|
|
||||||
Bug fix, feature, docs update, ...
|
|
||||||
|
|
||||||
# Description
|
|
||||||
|
|
||||||
Please include a summary of the change (current behavior vs new behavior), which issue is fixed (you can also link to an open issue here), and why this change is necessary.
|
|
||||||
|
|
||||||
# Test
|
|
||||||
|
|
||||||
Please describe the tests that you ran to verify your changes.
|
|
||||||
|
|
||||||
# Impact
|
|
||||||
|
|
||||||
Does this PR introduce a breaking change? What changes might users need to make due to this PR?
|
|
||||||
|
|
||||||
# Other Info
|
|
||||||
23
README.md
23
README.md
@@ -1,23 +0,0 @@
|
|||||||
<p align="center">
|
|
||||||
<a href="https://uaparser.js.org"><img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/uap-header.png"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# UAParser.js
|
|
||||||
|
|
||||||
Thank you for purchasing UAParser.js PRO Personal License, if you haven't please oreder here: https://store.faisalman.com
|
|
||||||
|
|
||||||
# Download
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install @ua-parser-js/pro-personal
|
|
||||||
```
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
https://docs.uaparser.js.org/v2
|
|
||||||
|
|
||||||
# License
|
|
||||||
|
|
||||||
UAParser.js PRO Personal
|
|
||||||
|
|
||||||
Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
To report a security issue, please email `f@faisalman.com` with a description of the issue, reproducible steps to get the issue, affected versions, and, if known, mitigations for the issue.
|
|
||||||
|
|
||||||
If the issue is confirmed as a vulnerability, we will open a new security advisory draft in our GitHub's Security Advisory page [https://github.com/faisalman/ua-parser-js/security/advisories](https://github.com/faisalman/ua-parser-js/security/advisories) and acknowledge your contributions as part of it. This project follows a 90 days disclosure timeline.
|
|
||||||
39
bower.json
Normal file
39
bower.json
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "ua-parser-js",
|
||||||
|
"version": "0.7.0",
|
||||||
|
"authors": [
|
||||||
|
"Faisal Salman <fyzlman@gmail.com>"
|
||||||
|
],
|
||||||
|
"private": false,
|
||||||
|
"main": "src/ua-parser.js",
|
||||||
|
"ignore": [
|
||||||
|
"build",
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"test",
|
||||||
|
"tests"
|
||||||
|
],
|
||||||
|
"contributors": [
|
||||||
|
"Faisal Salman <fyzlman@gmail.com>",
|
||||||
|
"Benjamin Bertrand <bertrand.design@gmail.com>",
|
||||||
|
"Christopher De Cairos <chris.decairos@gmail.com>",
|
||||||
|
"Davit Barbakadze <jayarjo@gmail.com>",
|
||||||
|
"Dmitry Tyschenko <dtyschenko@gmail.com>",
|
||||||
|
"Douglas Li <doug@knotch.it>",
|
||||||
|
"Erik Hesselink <hesselink@gmail.com>",
|
||||||
|
"Fabian Becker <halfdan@xnorfz.de>",
|
||||||
|
"Jackpoll <jackpoll123456@gmail.com>",
|
||||||
|
"Jake Mc <startswithaj@users.noreply.github.com>",
|
||||||
|
"John Tantalo <john.tantalo@gmail.com>",
|
||||||
|
"John Yanarella <jmy@codecatalyst.com>",
|
||||||
|
"Jon Buckley <jon@jbuckley.ca>",
|
||||||
|
"Lee Treveil <leetreveil@gmail.com>",
|
||||||
|
"Leonardo <leofiore@libero.it>",
|
||||||
|
"Michael Hess <mhess@connectify.me>",
|
||||||
|
"Ross Noble <rosshnoble@gmail.com>",
|
||||||
|
"Sandro Sonntag <sandro.sonntag@adorsys.de>"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
37
build/build.sh
Executable file
37
build/build.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
JSHINT_DIR="node_modules/jshint/bin/jshint"
|
||||||
|
MOCHA_DIR="node_modules/mocha/bin/mocha"
|
||||||
|
UGLIFY_DIR="node_modules/uglify-js/bin/uglifyjs"
|
||||||
|
|
||||||
|
# check module directory & install if not found
|
||||||
|
function check_module {
|
||||||
|
if ! type $2 &> /dev/null
|
||||||
|
then
|
||||||
|
echo "$2 is not found"
|
||||||
|
if ! type "npm" &> /dev/null
|
||||||
|
then
|
||||||
|
echo "npm is not installed"
|
||||||
|
echo "Exiting"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Installing $1..."
|
||||||
|
npm install $1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_module "jshint" $JSHINT_DIR
|
||||||
|
check_module "mocha" $MOCHA_DIR
|
||||||
|
check_module "uglify-js" $UGLIFY_DIR
|
||||||
|
|
||||||
|
echo "Verifiying code..."
|
||||||
|
$JSHINT_DIR src/ua-parser.js
|
||||||
|
|
||||||
|
echo "Running test..."
|
||||||
|
$MOCHA_DIR -R nyan test/test.js
|
||||||
|
|
||||||
|
echo "Minifying script..."
|
||||||
|
$UGLIFY_DIR src/ua-parser.js > src/ua-parser.min.js
|
||||||
|
echo "OK"
|
||||||
14
component.json
Normal file
14
component.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "ua-parser-js",
|
||||||
|
"version": "0.7.0",
|
||||||
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
|
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device", "cpu"],
|
||||||
|
"scripts": ["src/ua-parser.js"],
|
||||||
|
"main": "src/ua-parser.js",
|
||||||
|
"license": "MIT",
|
||||||
|
"development": {
|
||||||
|
"jshint/jshint": "*",
|
||||||
|
"visionmedia/mocha": "*",
|
||||||
|
"mishoo/uglifyjs2": "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
dist/ua-parser.html
vendored
1
dist/ua-parser.html
vendored
@@ -1 +0,0 @@
|
|||||||
<script src="./ua-parser.min.js"></script>
|
|
||||||
4
dist/ua-parser.min.js
vendored
4
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/ua-parser.pack.js
vendored
4
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
4959
package-lock.json
generated
4959
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.js
12
package.js
@@ -1,12 +0,0 @@
|
|||||||
Package.describe({
|
|
||||||
name: 'faisalman:ua-parser-js',
|
|
||||||
version: '2.0.0-beta.2',
|
|
||||||
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");
|
|
||||||
});
|
|
||||||
245
package.json
Executable file → Normal file
245
package.json
Executable file → Normal file
@@ -1,254 +1,67 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js PRO Personal",
|
"title": "UAParser.js",
|
||||||
"name": "@ua-parser-js/pro-personal",
|
"name": "ua-parser-js",
|
||||||
"version": "2.0.0-beta.2",
|
"version": "0.7.0",
|
||||||
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||||
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"user-agent",
|
"user-agent",
|
||||||
"client-hints",
|
|
||||||
"parser",
|
"parser",
|
||||||
"browser",
|
"browser",
|
||||||
"engine",
|
"engine",
|
||||||
"os",
|
"os",
|
||||||
"device",
|
"device",
|
||||||
"cpu",
|
"cpu"
|
||||||
"jquery-plugin",
|
|
||||||
"ecosystem:jquery",
|
|
||||||
"ua-parser-js",
|
|
||||||
"browser-detection",
|
|
||||||
"device-detection",
|
|
||||||
"os-detection"
|
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/faisalman/ua-parser-js",
|
"homepage": "http://github.com/faisalman/ua-parser-js",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Aamir Poonawalla <aamir@urx.com>",
|
"Faisal Salman <fyzlman@gmail.com>",
|
||||||
"Admas <mollases@users.noreply.github.com>",
|
|
||||||
"algenon <m@antonz.ru>",
|
|
||||||
"Alvin Portillo <alvin@8thwall.com>",
|
|
||||||
"Amumu <yoyo837@hotmail.com>",
|
|
||||||
"Andrea Vaghi <andrea.vaghi@jobrapido.com>",
|
|
||||||
"Anton Zhiyanov <m@antonz.ru>",
|
|
||||||
"Arturo Mejia <amejia@blim.com>",
|
|
||||||
"Arun Rama Reddy <arunramareddy@gmail.com>",
|
|
||||||
"Austin Pray <austin@austinpray.com>",
|
|
||||||
"Bendeguz <symunona@gmail.com>",
|
|
||||||
"Benjamin Bertrand <bertrand.design@gmail.com>",
|
"Benjamin Bertrand <bertrand.design@gmail.com>",
|
||||||
"Benjamin Urban <benjamin.urban@sueddeutsche.de>",
|
|
||||||
"boneyao <admin@boneyao.com>",
|
|
||||||
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
|
|
||||||
"CESAR RAMOS <c@imagenproactiva.com>",
|
|
||||||
"Chad Killingsworth <ckillingsworth@jackhenry.com>",
|
|
||||||
"chenhui9279 <chenhui9279@autohome.com.cn>",
|
|
||||||
"chenyuan-new <53860479+chenyuan-new@users.noreply.github.com>",
|
|
||||||
"Christopher De Cairos <chris.decairos@gmail.com>",
|
"Christopher De Cairos <chris.decairos@gmail.com>",
|
||||||
"Cyrille David <cyrille@qonto.eu>",
|
|
||||||
"Dante <duanjl.china@gmail.com>",
|
|
||||||
"Dario Vladovic <d.vladimyr@gmail.com>",
|
|
||||||
"David Annez <david.annez@gmail.com>",
|
|
||||||
"Davit Barbakadze <jayarjo@gmail.com>",
|
"Davit Barbakadze <jayarjo@gmail.com>",
|
||||||
"ddivernois <david-emmanuel.divernois@amadeus.com>",
|
|
||||||
"Deliaz <D3liaz@gmail.com>",
|
|
||||||
"Demis Palma <demis.palma@gmail.com>",
|
|
||||||
"dhoko <aurelien@protonmail.com>",
|
|
||||||
"dianhe <dianhe@webank.com>",
|
|
||||||
"dineshks1 <dineshks1@d.kumar44@outlook.com>",
|
|
||||||
"Dmitry Tyschenko <dtyschenko@gmail.com>",
|
"Dmitry Tyschenko <dtyschenko@gmail.com>",
|
||||||
"Douglas Li <doug@knotch.it>",
|
"Douglas Li <doug@knotch.it>",
|
||||||
"Dumitru Uzun <contact@duzun.me>",
|
|
||||||
"Dustin <duburns@fanatics.com>",
|
|
||||||
"Elchin Valiyev <elchin.valiyev@autodesk.com>",
|
|
||||||
"Emil Hesslow <hesslow@gmail.com>",
|
|
||||||
"Eric Redon <eric.redon@coox.org>",
|
|
||||||
"Eric Schrenker <eric.schrenker@gmail.com>",
|
|
||||||
"Erik Hesselink <hesselink@gmail.com>",
|
"Erik Hesselink <hesselink@gmail.com>",
|
||||||
"Fabian Becker <halfdan@xnorfz.de>",
|
"Fabian Becker <halfdan@xnorfz.de>",
|
||||||
"Faisal Salman <f@faisalman.com>",
|
"Jackpoll <jackpoll123456@gmail.com>",
|
||||||
"Frédéric Camblor <fcamblor@gmail.com>",
|
|
||||||
"Frederik Ring <frederik.ring@gmail.com>",
|
|
||||||
"Garrit Franke <garrit@slashdev.space>",
|
|
||||||
"Gerald Host <me@jacobford.co.uk>",
|
|
||||||
"Germán M. Bravo <german.mb@gmail.com>",
|
|
||||||
"Grigory Dmitrenko <grigory@snsk.ru>",
|
|
||||||
"gulpin <gulping.gulpin@gmail.com>",
|
|
||||||
"Hans Ott <hansott@hotmail.be>",
|
|
||||||
"Hendrik Helwich <h.helwich@iplabs.de>",
|
|
||||||
"Hermann Ebert <ebbmo@HE.local>",
|
|
||||||
"hr6r <hedian@gmail.com>",
|
|
||||||
"Igor Topal <i.topal@smartweb.com.ua>",
|
|
||||||
"Ildar Kamalov <i.kamalov@adguard.com>",
|
|
||||||
"insanehong <insane.hong@navercorp.com>",
|
|
||||||
"jackpoll <jackpoll123456@gmail.com>",
|
|
||||||
"Jacky Choo <jackychoo@adly-macbook.local>",
|
|
||||||
"Jake Mc <startswithaj@users.noreply.github.com>",
|
"Jake Mc <startswithaj@users.noreply.github.com>",
|
||||||
"JBYoshi <12983479+JBYoshi@users.noreply.github.com>",
|
|
||||||
"Joey Parrish <joeyparrish@google.com>",
|
|
||||||
"John Tantalo <john.tantalo@gmail.com>",
|
"John Tantalo <john.tantalo@gmail.com>",
|
||||||
"John Yanarella <jmy@codecatalyst.com>",
|
"John Yanarella <jmy@codecatalyst.com>",
|
||||||
"Jon Buckley <jon@jbuckley.ca>",
|
"Jon Buckley <jon@jbuckley.ca>",
|
||||||
"Josh Goldberg <joshuakgoldberg@outlook.com>",
|
|
||||||
"Junki-Ishida <junki_ishida@dwango.co.jp>",
|
|
||||||
"Kendall Buchanan <kendall@kendagriff.com>",
|
|
||||||
"KnifeLemon <role___play@naver.com>",
|
|
||||||
"kNoAPP <alldoneb@gmail.com>",
|
|
||||||
"Lee Treveil <leetreveil@gmail.com>",
|
"Lee Treveil <leetreveil@gmail.com>",
|
||||||
"leonardo <leofiore@libero.it>",
|
"Leonardo <leofiore@libero.it>",
|
||||||
"Levente Balogh <balogh.levente.hu@gmail.com>",
|
|
||||||
"Liam Quinn <lquinn@blackberry.com>",
|
|
||||||
"Lithin <lithin@webklipper.com>",
|
|
||||||
"liujunlve <liujunlve@henhaoji.com>",
|
|
||||||
"ll-syber <670159357@qq.com>",
|
|
||||||
"Loris Guignard <loris.guignard@gmail.com>",
|
|
||||||
"Lukas Drgon <lukas.drgon@gmail.com>",
|
|
||||||
"Lukas Eipert <leipert@users.noreply.github.com>",
|
|
||||||
"Malash <i@malash.me>",
|
|
||||||
"Martynas <martynas@firmfirm.co>",
|
|
||||||
"Masahiko Sato <masasato@yahoo-corp.jp>",
|
|
||||||
"Matt Brophy <matt@brophy.org>",
|
|
||||||
"Matthew Origer <karatecowboy@gmail.com>",
|
|
||||||
"Maximilian Haupt <mail@maximilianhaupt.com>",
|
|
||||||
"Max Maurer <maxemanuel.maurer@gmail.com>",
|
|
||||||
"Max Nordlund <max.nordlund@gmail.com>",
|
|
||||||
"Michael Hess <mhess@connectify.me>",
|
"Michael Hess <mhess@connectify.me>",
|
||||||
"MimyyK <michele.marais@hakisa.com>",
|
|
||||||
"Mok <mok@moekm.com>",
|
|
||||||
"nabetama <mao.nabeta@gmail.com>",
|
|
||||||
"naoh <naoh.cs03g@nctu.edu.tw>",
|
|
||||||
"Nicholas Ionata <nionata@ufl.edu>",
|
|
||||||
"Nikhil Motiani <nikhil.motiani@outlook.com>",
|
|
||||||
"Nik Rolls <nik@rolls.cc>",
|
|
||||||
"nionata <n.ionata129@gmail.com>",
|
|
||||||
"niris <nirisix@gmail.com>",
|
|
||||||
"Nobuo Okada <nookada@yahoo-corp.jp>",
|
|
||||||
"o.drapeza <o.drapeza@tinkoff.ru>",
|
|
||||||
"Oscar Becerra <oscarbecerra@google.com>",
|
|
||||||
"otakuSiD <otakusid@gmail.com>",
|
|
||||||
"Paris Morgan <paris@8thwall.com>",
|
|
||||||
"patrick-nurt <github@pereira.dk>",
|
|
||||||
"Pavel Studeny <studeny@avast.com>",
|
|
||||||
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
|
|
||||||
"philippsimon <github@philippsimon.de>",
|
|
||||||
"Pieter Hendrickx <pieter.hendrickx@belfius.be>",
|
|
||||||
"Piper Chester <piperchester@gmail.com>",
|
|
||||||
"Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>",
|
|
||||||
"Raine Makelainen <raine.makelainen@jolla.com>",
|
|
||||||
"Raman Savaryn <homeneartheocean@gmail.com>",
|
|
||||||
"Riley Shaw <rileyjshaw@users.noreply.github.com>",
|
|
||||||
"Robert Tod <robert@qubit.com>",
|
|
||||||
"roman.savarin <roman.savarin@skywindgroup.com>",
|
|
||||||
"Ron Korland <ron@testim.io>",
|
|
||||||
"Ross Noble <rosshnoble@gmail.com>",
|
"Ross Noble <rosshnoble@gmail.com>",
|
||||||
"ruicong <466403866@qq.com>",
|
"Sandro Sonntag <sandro.sonntag@adorsys.de>"
|
||||||
"Runar Heggset <rukki093@gmail.com>",
|
|
||||||
"Ryohei Shima <shima01dev@gmail.com>",
|
|
||||||
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
|
|
||||||
"sgautrea <shanegautreau@gmail.com>",
|
|
||||||
"shaharmor <shahar@peer5.com>",
|
|
||||||
"Shane Gautreau <sgautrea@opentext.com>",
|
|
||||||
"Shane Thacker <shane@steadymade.com>",
|
|
||||||
"Shreedhar <shreedhar@uber.com>",
|
|
||||||
"Simon Eisenmann <simon@longsleep.org>",
|
|
||||||
"Simon Lang <me@simonlang.org>",
|
|
||||||
"Stiekel <histkc@gmail.com>",
|
|
||||||
"sunny-mwx <30586210+sunny-mwx@users.noreply.github.com>",
|
|
||||||
"sUP <dani3l@gmail.com>",
|
|
||||||
"Sylvain Gizard <sylvain.gizard@gmail.com>",
|
|
||||||
"szchenghuang <szchenghuang@gmail.com>",
|
|
||||||
"Tanguy Krotoff <tkrotoff@gmail.com>",
|
|
||||||
"Tony Tomarchio <tony@tomarchio.cc>",
|
|
||||||
"Ulrich Schmidt <u.schmidt@velian.de>",
|
|
||||||
"Vadim Kurachevsky <vadim@hmvs.org>",
|
|
||||||
"Varun Sharma <varunsh@stepsecurity.io>",
|
|
||||||
"XhmikosR <xhmikosr@gmail.com>",
|
|
||||||
"Yılmaz <yilmazdemir36@gmail.com>",
|
|
||||||
"yuanyang <work_yuanyang@163.com>",
|
|
||||||
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
|
|
||||||
"Zach Bjornson <zbbjornson@gmail.com>",
|
|
||||||
"Ziding Zhang <zidingz@gmail.com>"
|
|
||||||
],
|
|
||||||
"type": "commonjs",
|
|
||||||
"types": "src/main/ua-parser.d.ts",
|
|
||||||
"main": "src/main/ua-parser.js",
|
|
||||||
"module": "src/main/ua-parser.mjs",
|
|
||||||
"browser": "dist/ua-parser.pack.js",
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"require": "./src/main/ua-parser.js",
|
|
||||||
"import": "./src/main/ua-parser.mjs",
|
|
||||||
"types": "./src/main/ua-parser.d.ts"
|
|
||||||
},
|
|
||||||
"./enums": {
|
|
||||||
"require": "./src/enums/ua-parser-enums.js",
|
|
||||||
"import": "./src/enums/ua-parser-enums.mjs"
|
|
||||||
},
|
|
||||||
"./extensions": {
|
|
||||||
"require": "./src/extensions/ua-parser-extensions.js",
|
|
||||||
"import": "./src/extensions/ua-parser-extensions.mjs",
|
|
||||||
"types": "./src/extensions/ua-parser-extensions.d.ts"
|
|
||||||
},
|
|
||||||
"./helpers": {
|
|
||||||
"require": "./src/helpers/ua-parser-helpers.js",
|
|
||||||
"import": "./src/helpers/ua-parser-helpers.mjs",
|
|
||||||
"types": "./src/helpers/ua-parser-helpers.d.ts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist",
|
|
||||||
"src"
|
|
||||||
],
|
],
|
||||||
|
"main": "src/ua-parser.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./script/build-dist.sh && ./script/build-module.js",
|
"test": "./build/build.sh"
|
||||||
"build+test": "npm run build && npm run test",
|
|
||||||
"fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync",
|
|
||||||
"test": "./script/test-all.sh",
|
|
||||||
"test:dts-lint": "tsd --typings src/main/ua-parser.d.ts --files test/dts-test.ts",
|
|
||||||
"test:eslint": "eslint src && eslint script",
|
|
||||||
"test:jshint": "jshint src/main",
|
|
||||||
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
|
|
||||||
"test:mocha": "mocha -R list test/mocha*js",
|
|
||||||
"test:playwright": "playwright test"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/parser": "7.15.8",
|
"jshint": "~1.1.0",
|
||||||
"@babel/traverse": "7.23.2",
|
"mocha": "~1.7.1",
|
||||||
"@jazzer.js/core": "^1.4.0",
|
"uglify-js": "~1.3.4"
|
||||||
"@playwright/test": "~1.32.2",
|
|
||||||
"jshint": "~2.13.6",
|
|
||||||
"mocha": "~8.2.0",
|
|
||||||
"requirejs": "2.3.2",
|
|
||||||
"safe-regex": "^2.1.1",
|
|
||||||
"tsd": "^0.29.0",
|
|
||||||
"uglify-js": "~3.12.0"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository" : {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/faisalman/ua-parser-js.git"
|
"url": "https://github.com/faisalman/ua-parser-js.git"
|
||||||
},
|
},
|
||||||
"license": "UAParser.js-PRO-Personal",
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "GPLv2",
|
||||||
|
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "http://www.opensource.org/licenses/mit-license.php"
|
||||||
|
}
|
||||||
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"dist": "dist",
|
"lib": "src",
|
||||||
"script": "script",
|
|
||||||
"src": "src",
|
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
}
|
||||||
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
|
||||||
"demo": "https://uaparser.js.org",
|
|
||||||
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.pack.js",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/ua-parser-js"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "paypal",
|
|
||||||
"url": "https://paypal.me/faisalman"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/faisalman"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
259
readme.md
Normal file
259
readme.md
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
# UAParser.js
|
||||||
|
|
||||||
|
Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as Component package, Bower package, jQuery.ua, & AMD module
|
||||||
|
|
||||||
|
[](https://travis-ci.org/faisalman/ua-parser-js)
|
||||||
|
|
||||||
|
* Author : Faisalman <<fyzlman@gmail.com>>
|
||||||
|
* Demo : http://faisalman.github.com/ua-parser-js
|
||||||
|
* Source : https://github.com/faisalman/ua-parser-js
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
Extract detailed type of web browser, layout engine, operating system, cpu architecture, and device purely from user-agent string with relatively lightweight footprint (~7KB minified / ~3KB gzipped). Written in vanilla js, which means it doesn't depends on any other library.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
* `getBrowser()`
|
||||||
|
* returns `{ name: '', major: '', version: '' }`
|
||||||
|
|
||||||
|
```
|
||||||
|
# Possible 'browser.name':
|
||||||
|
Amaya, Arora, Avant, Baidu, Blazer, Bolt, Camino, Chimera, Chrome, Chromium,
|
||||||
|
Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Epiphany, Fennec, Firebird,
|
||||||
|
Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDragon,
|
||||||
|
Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links,
|
||||||
|
Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, [Mobile] Safari, Mosaic, Mozilla,
|
||||||
|
Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], Phoenix,
|
||||||
|
Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser, Swiftfox,
|
||||||
|
Tizen, UCBrowser, w3m, Yandex
|
||||||
|
|
||||||
|
# 'browser.version' & 'browser.major' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getDevice()`
|
||||||
|
* returns `{ model: '', type: '', vendor: '' }`
|
||||||
|
|
||||||
|
```
|
||||||
|
# Possible 'device.type':
|
||||||
|
console, mobile, tablet
|
||||||
|
|
||||||
|
# Possible 'device.vendor':
|
||||||
|
Acer, Alcatel, Apple, Asus, BenQ, BlackBerry, Dell, GeeksPhone, HP, HTC, Huawei,
|
||||||
|
Lenovo, LG, Meizu, Motorola, Nexian, Nintendo, Nokia, Palm, Panasonic,
|
||||||
|
RIM, Samsung, Siemens, Sony-Ericsson, Sprint, ZTE
|
||||||
|
|
||||||
|
# 'device.model' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getEngine()`
|
||||||
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
|
```
|
||||||
|
# Possible 'engine.name'
|
||||||
|
Amaya, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, Tasman,
|
||||||
|
Trident, w3m, WebKit
|
||||||
|
|
||||||
|
# 'engine.version' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getOS()`
|
||||||
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
|
```
|
||||||
|
# Possible 'os.name'
|
||||||
|
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
|
||||||
|
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
|
||||||
|
Joli, Linux, Mac OS, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD, Nintendo,
|
||||||
|
OpenBSD, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat, RIM Tablet OS,
|
||||||
|
RISC OS, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, UNIX, WebOS,
|
||||||
|
Windows [Phone/Mobile], Zenwalk
|
||||||
|
|
||||||
|
# 'os.version' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getCPU()`
|
||||||
|
* returns `{ architecture: '' }`
|
||||||
|
|
||||||
|
```
|
||||||
|
# Possible 'cpu.architecture'
|
||||||
|
68k, amd64, arm, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getResult()`
|
||||||
|
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||||
|
* `getUA()`
|
||||||
|
* returns UA string of current instance
|
||||||
|
* `setUA(uastring)`
|
||||||
|
* set & parse UA string
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script type="text/javascript" src="ua-parser.min.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var parser = new UAParser();
|
||||||
|
|
||||||
|
// by default it takes ua string from current browser's window.navigator.userAgent
|
||||||
|
console.log(parser.getResult());
|
||||||
|
/*
|
||||||
|
/// this will print an object structured like this:
|
||||||
|
{
|
||||||
|
ua: "",
|
||||||
|
browser: {
|
||||||
|
name: "",
|
||||||
|
version: "",
|
||||||
|
major: ""
|
||||||
|
},
|
||||||
|
engine: {
|
||||||
|
name: "",
|
||||||
|
version: ""
|
||||||
|
},
|
||||||
|
os: {
|
||||||
|
name: "",
|
||||||
|
version: ""
|
||||||
|
},
|
||||||
|
device: {
|
||||||
|
model: "",
|
||||||
|
type: "",
|
||||||
|
vendor: ""
|
||||||
|
},
|
||||||
|
cpu: {
|
||||||
|
architecture: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// let's test a custom user-agent string as an example
|
||||||
|
var uastring = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 Chrome/15.0.874.106 Safari/535.2";
|
||||||
|
parser.setUA(uastring);
|
||||||
|
|
||||||
|
var result = parser.getResult();
|
||||||
|
// this will also produce the same result (without instantiation):
|
||||||
|
// var result = UAParser(uastring);
|
||||||
|
|
||||||
|
console.log(result.browser); // {name: "Chromium", major: "15", version: "15.0.874.106"}
|
||||||
|
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
|
||||||
|
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
|
||||||
|
console.log(result.os.version); // "11.10"
|
||||||
|
console.log(result.engine.name); // "WebKit"
|
||||||
|
console.log(result.cpu.architecture); // "amd64"
|
||||||
|
|
||||||
|
// do some other tests
|
||||||
|
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)";
|
||||||
|
console.log(parser.setUA(uastring2).getBrowser().name); // "Konqueror"
|
||||||
|
console.log(parser.getOS()); // {name: "OpenBSD", version: undefined}
|
||||||
|
console.log(parser.getEngine()); // {name: "KHTML", version: "4.1.4"}
|
||||||
|
|
||||||
|
var uastring3 = 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Version/7.1.0.7 Safari/534.11';
|
||||||
|
console.log(parser.setUA(uastring3).getDevice().model); // "PlayBook"
|
||||||
|
console.log(parser.getOS()) // {name: "RIM Tablet OS", version: "1.0.0"}
|
||||||
|
console.log(parser.getBrowser().name); // "Safari"
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using node.js
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install ua-parser-js
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
var UAParser = require('ua-parser-js');
|
||||||
|
var parser = new UAParser();
|
||||||
|
var ua = request.headers['user-agent']; // user-agent header from an HTTP request
|
||||||
|
console.log(parser.setUA(ua).getResult());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using requirejs
|
||||||
|
|
||||||
|
```js
|
||||||
|
require(['ua-parser'], function(UAParser) {
|
||||||
|
var parser = new UAParser();
|
||||||
|
console.log(parser.getResult());
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using component
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ component install faisalman/ua-parser-js
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
var UAParser = require('ua-parser-js');
|
||||||
|
var parser = new UAParser();
|
||||||
|
console.log(parser.getResult());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using bower
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ bower install ua-parser-js
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using jQuery.ua
|
||||||
|
|
||||||
|
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
|
||||||
|
|
||||||
|
// Do some tests
|
||||||
|
console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"}
|
||||||
|
console.log($.ua.os); // {name: "Android", version: "2.3.4"}
|
||||||
|
console.log($.ua.os.name); // "Android"
|
||||||
|
console.log($.ua.get()); // "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0"
|
||||||
|
|
||||||
|
// reset to custom user-agent
|
||||||
|
$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13');
|
||||||
|
|
||||||
|
// Test again
|
||||||
|
console.log($.ua.browser.name); // "Safari"
|
||||||
|
console.log($.ua.engine.name); // "Webkit"
|
||||||
|
console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"}
|
||||||
|
console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Install dependencies
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install jshint
|
||||||
|
$ npm install mocha
|
||||||
|
$ npm install uglify-js
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify, test, & minify script
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ./build/build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Dual licensed under GPLv2 & MIT
|
||||||
|
|
||||||
|
Copyright © 2012-2013 Faisalman <<fyzlman@gmail.com>>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to use,
|
||||||
|
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
||||||
|
Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SRC_PATH="src/main/ua-parser.js"
|
|
||||||
MIN_PATH="dist/ua-parser.min.js"
|
|
||||||
PACK_PATH="dist/ua-parser.pack.js"
|
|
||||||
|
|
||||||
# minified
|
|
||||||
echo "Generate ${MIN_PATH}"
|
|
||||||
uglifyjs $SRC_PATH -o $MIN_PATH --comments "/^ UA/"
|
|
||||||
|
|
||||||
# packed
|
|
||||||
echo "Generate ${PACK_PATH}"
|
|
||||||
uglifyjs $SRC_PATH -o $PACK_PATH --comments "/^ UA/" --compress --mangle
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
/* jshint esversion: 6 */
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const generateMJS = (module) => {
|
|
||||||
let { src, dest, title, replacements } = module;
|
|
||||||
let text = fs.readFileSync(src, 'utf-8');
|
|
||||||
|
|
||||||
replacements.push(
|
|
||||||
[/const (.+?)\s*=\s*require\((.+)\)/ig, 'import $1 from $2'],
|
|
||||||
[/module\.exports =/ig, 'export']
|
|
||||||
);
|
|
||||||
replacements.forEach(rep => {
|
|
||||||
text = text.replace(rep[0], rep[1]);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Generate ${dest}`);
|
|
||||||
|
|
||||||
fs.writeFileSync(dest,
|
|
||||||
`// Generated ESM version of ${title}
|
|
||||||
// DO NOT EDIT THIS FILE!
|
|
||||||
// Source: /${src}
|
|
||||||
|
|
||||||
${text}`, 'utf-8');
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const modules = [
|
|
||||||
{
|
|
||||||
src : 'src/main/ua-parser.js',
|
|
||||||
dest : 'src/main/ua-parser.mjs',
|
|
||||||
title : 'ua-parser-js',
|
|
||||||
replacements : [
|
|
||||||
[/\(func[\s\S]+strict\';/ig, ''],
|
|
||||||
[/esversion\: 3/ig, 'esversion: 6'],
|
|
||||||
[/\/[\/\s]+export[\s\S]+/ig,'export {UAParser};']
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
src : 'src/enums/ua-parser-enums.js',
|
|
||||||
dest :'src/enums/ua-parser-enums.mjs',
|
|
||||||
title : 'ua-parser-js/enums',
|
|
||||||
replacements : []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src : 'src/extensions/ua-parser-extensions.js',
|
|
||||||
dest : 'src/extensions/ua-parser-extensions.mjs',
|
|
||||||
title : 'ua-parser-js/extensions',
|
|
||||||
replacements : []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src : 'src/helpers/ua-parser-helpers.js',
|
|
||||||
dest : 'src/helpers/ua-parser-helpers.mjs',
|
|
||||||
title : 'ua-parser-js/helpers',
|
|
||||||
replacements : []
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
modules.forEach(module => generateMJS(module));
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- run build
|
|
||||||
'
|
|
||||||
npm run build || exit 1
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- lint js code
|
|
||||||
'
|
|
||||||
npm run test:jshint || exit 1
|
|
||||||
#npm run test:eslint || exit 1
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- test using mocha
|
|
||||||
'
|
|
||||||
npm run test:mocha || exit 1
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- test using playwright
|
|
||||||
'
|
|
||||||
npm run test:playwright || exit 1
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- lint lockfile
|
|
||||||
'
|
|
||||||
npm run test:lockfile-lint || exit 1
|
|
||||||
|
|
||||||
echo '
|
|
||||||
- lint d.ts files
|
|
||||||
'
|
|
||||||
npm run test:dts-lint || exit 1
|
|
||||||
@@ -1,350 +0,0 @@
|
|||||||
///////////////////////////////////////////////
|
|
||||||
/* Enums for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
UAParser.js PRO Personal License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
const Browser = Object.freeze({
|
|
||||||
_2345_EXPLORER: '2345Explorer',
|
|
||||||
_360: '360 Browser',
|
|
||||||
ALIPAY: 'Alipay',
|
|
||||||
AMAYA: 'Amaya',
|
|
||||||
ANDROID: 'Android Browser',
|
|
||||||
ARORA: 'Arora',
|
|
||||||
AVANT: 'Avant',
|
|
||||||
AVAST: 'Avast Secure Browser',
|
|
||||||
AVG: 'AVG Secure Browser',
|
|
||||||
BAIDU: 'Baidu Browser',
|
|
||||||
BASILISK: 'Basilisk',
|
|
||||||
BLAZER: 'Blazer',
|
|
||||||
BOLT: 'Bolt',
|
|
||||||
BOWSER: 'Bowser',
|
|
||||||
BRAVE: 'Brave',
|
|
||||||
CAMINO: 'Camino',
|
|
||||||
CHIMERA: 'Chimera',
|
|
||||||
CHROME: 'Chrome',
|
|
||||||
CHROME_HEADLESS: 'Chrome Headless',
|
|
||||||
CHROME_MOBILE: 'Mobile Chrome',
|
|
||||||
CHROME_WEBVIEW: 'Chrome WebView',
|
|
||||||
CHROMIUM: 'Chromium',
|
|
||||||
COBALT: 'Cobalt',
|
|
||||||
COC_COC: 'Coc Coc',
|
|
||||||
COMODO_DRAGON: 'Comodo Dragon',
|
|
||||||
CONKEROR: 'Conkeror',
|
|
||||||
DILLO: 'Dillo',
|
|
||||||
DOLPHIN: 'Dolphin',
|
|
||||||
DORIS: 'Doris',
|
|
||||||
DUCKDUCKGO: 'DuckDuckGo',
|
|
||||||
EDGE: 'Edge',
|
|
||||||
EPIPHANY: 'Epiphany',
|
|
||||||
FACEBOOK: 'Facebook',
|
|
||||||
FALKON: 'Falkon',
|
|
||||||
FIREBIRD: 'Firebird',
|
|
||||||
FIREFOX: 'Firefox',
|
|
||||||
FIREFOX_FOCUS: 'Firefox Focus',
|
|
||||||
FIREFOX_MOBILE: 'Mobile Firefox',
|
|
||||||
FIREFOX_REALITY: 'Firefox Reality',
|
|
||||||
FENNEC: 'Fennec',
|
|
||||||
FLOCK: 'Flock',
|
|
||||||
FLOW: 'Flow',
|
|
||||||
GO: 'Go Browser',
|
|
||||||
GOOGLE_SEARCH: 'GSA',
|
|
||||||
HEYTAP: 'HeyTap',
|
|
||||||
HUAWEI: 'Huawei Browser',
|
|
||||||
ICAB: 'iCab',
|
|
||||||
ICE: 'ICE Browser',
|
|
||||||
ICEAPE: 'IceApe',
|
|
||||||
ICECAT: 'IceCat',
|
|
||||||
ICEDRAGON: 'IceDragon',
|
|
||||||
ICEWEASEL: 'IceWeasel',
|
|
||||||
IE: 'IE',
|
|
||||||
INSTAGRAM: 'Instagram',
|
|
||||||
IRIDIUM: 'Iridium',
|
|
||||||
IRON: 'Iron',
|
|
||||||
JASMINE: 'Jasmine',
|
|
||||||
KONQUEROR: 'Konqueror',
|
|
||||||
KAKAO: 'KakaoTalk',
|
|
||||||
KHTML: 'KHTML',
|
|
||||||
K_MELEON: 'K-Meleon',
|
|
||||||
KLAR: 'Klar',
|
|
||||||
KLARNA: 'Klarna',
|
|
||||||
KINDLE: 'Kindle',
|
|
||||||
LENOVO: 'Smart Lenovo Browser',
|
|
||||||
LIEBAO: 'LBBROWSER',
|
|
||||||
LINE: 'Line',
|
|
||||||
LINKEDIN: 'LinkedIn',
|
|
||||||
LINKS: 'Links',
|
|
||||||
LUNASCAPE: 'Lunascape',
|
|
||||||
LYNX: 'Lynx',
|
|
||||||
MAEMO: 'Maemo Browser',
|
|
||||||
MAXTHON: 'Maxthon',
|
|
||||||
MIDORI: 'Midori',
|
|
||||||
MINIMO: 'Minimo',
|
|
||||||
MIUI: 'MIUI Browser',
|
|
||||||
MOZILLA: 'Mozilla',
|
|
||||||
MOSAIC: 'Mosaic',
|
|
||||||
NAVER: 'Naver',
|
|
||||||
NETFRONT: 'NetFront',
|
|
||||||
NETSCAPE: 'Netscape',
|
|
||||||
NETSURF: 'Netsurf',
|
|
||||||
NOKIA: 'Nokia Browser',
|
|
||||||
OBIGO: 'Obigo',
|
|
||||||
OCULUS: 'Oculus Browser',
|
|
||||||
OMNIWEB: 'OmniWeb',
|
|
||||||
OPERA: 'Opera',
|
|
||||||
OPERA_COAST: 'Opera Coast',
|
|
||||||
OPERA_MINI: 'Opera Mini',
|
|
||||||
OPERA_MOBI: 'Opera Mobi',
|
|
||||||
OPERA_TABLET: 'Opera Tablet',
|
|
||||||
OPERA_TOUCH: 'Opera Touch',
|
|
||||||
OVI: 'OviBrowser',
|
|
||||||
PALEMOON: 'PaleMoon',
|
|
||||||
PHANTOMJS: 'PhantomJS',
|
|
||||||
PHOENIX: 'Phoenix',
|
|
||||||
POLARIS: 'Polaris',
|
|
||||||
PUFFIN: 'Puffin',
|
|
||||||
QQ: 'QQBrowser',
|
|
||||||
QQ_LITE: 'QQBrowserLite',
|
|
||||||
QUARK: 'Quark',
|
|
||||||
QUPZILLA: 'QupZilla',
|
|
||||||
REKONQ: 'rekonq',
|
|
||||||
ROCKMELT: 'Rockmelt',
|
|
||||||
SAFARI: 'Safari',
|
|
||||||
SAFARI_MOBILE: 'Mobile Safari',
|
|
||||||
SAILFISH: 'Sailfish Browser',
|
|
||||||
SAMSUNG: 'Samsung Internet',
|
|
||||||
SEAMONKEY: 'SeaMonkey',
|
|
||||||
SILK: 'Silk',
|
|
||||||
SKYFIRE: 'Skyfire',
|
|
||||||
SLEIPNIR: 'Sleipnir',
|
|
||||||
SLIMBROWSER: 'SlimBrowser',
|
|
||||||
SNAPCHAT: 'Snapchat',
|
|
||||||
SOGOU_EXPLORER: 'Sogou Explorer',
|
|
||||||
SOGOU_MOBILE: 'Sogou Mobile',
|
|
||||||
SWIFTFOX: 'Swiftfox',
|
|
||||||
TESLA: 'Tesla',
|
|
||||||
TIKTOK: 'TikTok',
|
|
||||||
TIZEN: 'Tizen Browser',
|
|
||||||
UC: 'UCBrowser',
|
|
||||||
UP: 'UP.Browser',
|
|
||||||
VIERA: 'Viera',
|
|
||||||
VIVALDI: 'Vivaldi',
|
|
||||||
VIVO: 'Vivo Browser',
|
|
||||||
W3M: 'w3m',
|
|
||||||
WATERFOX: 'Waterfox',
|
|
||||||
WEBKIT: 'WebKit',
|
|
||||||
WECHAT: 'WeChat',
|
|
||||||
WEIBO: 'Weibo',
|
|
||||||
WHALE: 'Whale',
|
|
||||||
YANDEX: 'Yandex'
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
const CPU = Object.freeze({
|
|
||||||
ARM : 'arm',
|
|
||||||
ARM_64: 'arm64',
|
|
||||||
ARM_HF: 'armhf',
|
|
||||||
AVR: 'avr',
|
|
||||||
AVR_32: 'avr32',
|
|
||||||
IA64: 'ia64',
|
|
||||||
IRIX: 'irix',
|
|
||||||
IRIX_64: 'irix64',
|
|
||||||
MIPS: 'mips',
|
|
||||||
MIPS_64: 'mips64',
|
|
||||||
M68K: '68k',
|
|
||||||
PA_RISC: 'pa-risc',
|
|
||||||
PPC: 'ppc',
|
|
||||||
SPARC: 'sparc',
|
|
||||||
SPARC_64: 'sparc64',
|
|
||||||
X86: 'ia32',
|
|
||||||
X86_64: 'amd64'
|
|
||||||
});
|
|
||||||
|
|
||||||
const Device = Object.freeze({
|
|
||||||
CONSOLE: 'console',
|
|
||||||
DESKTOP: 'desktop',
|
|
||||||
EMBEDDED: 'embedded',
|
|
||||||
MOBILE: 'mobile',
|
|
||||||
SMARTTV: 'smarttv',
|
|
||||||
TABLET: 'tablet',
|
|
||||||
WEARABLE: 'wearable'
|
|
||||||
});
|
|
||||||
|
|
||||||
const Vendor = Object.freeze({
|
|
||||||
ACER: 'Acer',
|
|
||||||
ALCATEL: 'Alcatel',
|
|
||||||
APPLE: 'Apple',
|
|
||||||
AMAZON: 'Amazon',
|
|
||||||
ARCHOS: 'Archos',
|
|
||||||
ASUS: 'ASUS',
|
|
||||||
ATT: 'AT&T',
|
|
||||||
BENQ: 'BenQ',
|
|
||||||
BLACKBERRY: 'BlackBerry',
|
|
||||||
DELL: 'Dell',
|
|
||||||
ESSENTIAL: 'Essential',
|
|
||||||
FACEBOOK: 'Facebook',
|
|
||||||
FAIRPHONE: 'Fairphone',
|
|
||||||
GEEKSPHONE: 'GeeksPhone',
|
|
||||||
GENERIC: 'Generic',
|
|
||||||
GOOGLE: 'Google',
|
|
||||||
HP: 'HP',
|
|
||||||
HTC: 'HTC',
|
|
||||||
HUAWEI: 'Huawei',
|
|
||||||
INFINIX: 'Infinix',
|
|
||||||
JOLLA: 'Jolla',
|
|
||||||
KOBO: 'Kobo',
|
|
||||||
LENOVO: 'Lenovo',
|
|
||||||
LG: 'LG',
|
|
||||||
MEIZU: 'Meizu',
|
|
||||||
MICROSOFT: 'Microsoft',
|
|
||||||
MOTOROLA: 'Motorola',
|
|
||||||
NEXIAN: 'Nexian',
|
|
||||||
NINTENDO: 'Nintendo',
|
|
||||||
NOKIA: 'Nokia',
|
|
||||||
NVIDIA: 'Nvidia',
|
|
||||||
ONEPLUS: 'OnePlus',
|
|
||||||
OPPO: 'OPPO',
|
|
||||||
OUYA: 'Ouya',
|
|
||||||
PALM: 'Palm',
|
|
||||||
PANASONIC: 'Panasonic',
|
|
||||||
PEBBLE: 'Pebble',
|
|
||||||
POLYTRON: 'Polytron',
|
|
||||||
REALME: 'Realme',
|
|
||||||
RIM: 'RIM',
|
|
||||||
ROKU: 'Roku',
|
|
||||||
SAMSUNG: 'Samsung',
|
|
||||||
SHARP: 'Sharp',
|
|
||||||
SIEMENS: 'Siemens',
|
|
||||||
SONY: 'Sony',
|
|
||||||
SPRINT: 'Sprint',
|
|
||||||
TECHNISAT: 'TechniSAT',
|
|
||||||
TECNO: 'Tecno',
|
|
||||||
TESLA: 'Tesla',
|
|
||||||
ULEFONE: 'Ulefone',
|
|
||||||
VIVO: 'Vivo',
|
|
||||||
VODAFONE: 'Vodafone',
|
|
||||||
XBOX: 'Xbox',
|
|
||||||
XIAOMI: 'Xiaomi',
|
|
||||||
ZEBRA: 'Zebra',
|
|
||||||
ZTE: 'ZTE',
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
const Engine = Object.freeze({
|
|
||||||
AMAYA: 'Amaya',
|
|
||||||
BLINK: 'Blink',
|
|
||||||
EDGEHTML: 'EdgeHTML',
|
|
||||||
FLOW: 'Flow',
|
|
||||||
GECKO: 'Gecko',
|
|
||||||
GOANNA: 'Goanna',
|
|
||||||
ICAB: 'iCab',
|
|
||||||
KHTML: 'KHTML',
|
|
||||||
LIBWEB: 'LibWeb',
|
|
||||||
LINKS: 'Links',
|
|
||||||
LYNX: 'Lynx',
|
|
||||||
NETFRONT: 'NetFront',
|
|
||||||
NETSURF: 'NetSurf',
|
|
||||||
PRESTO: 'Presto',
|
|
||||||
TASMAN: 'Tasman',
|
|
||||||
TRIDENT: 'Trident',
|
|
||||||
W3M: 'w3m',
|
|
||||||
WEBKIT: 'WebKit'
|
|
||||||
});
|
|
||||||
|
|
||||||
const OS = Object.freeze({
|
|
||||||
AIX: 'AIX',
|
|
||||||
AMIGA_OS: 'Amiga OS',
|
|
||||||
ANDROID: 'Android',
|
|
||||||
ANDROID_X86: 'Android-x86',
|
|
||||||
ARCH: 'Arch',
|
|
||||||
BADA: 'Bada',
|
|
||||||
BEOS: 'BeOS',
|
|
||||||
BLACKBERRY: 'BlackBerry',
|
|
||||||
CENTOS: 'CentOS',
|
|
||||||
CHROME_OS: 'Chrome OS',
|
|
||||||
CHROMECAST: 'Chromecast',
|
|
||||||
CONTIKI: 'Contiki',
|
|
||||||
DEBIAN: 'Debian',
|
|
||||||
DEEPIN: 'Deepin',
|
|
||||||
DRAGONFLY: 'DragonFly',
|
|
||||||
ELEMENTARY_OS: 'elementary OS',
|
|
||||||
FEDORA: 'Fedora',
|
|
||||||
FIREFOX_OS: 'Firefox OS',
|
|
||||||
FREEBSD: 'FreeBSD',
|
|
||||||
FUCHSIA: 'Fuchsia',
|
|
||||||
GENTOO: 'Gentoo',
|
|
||||||
GHOSTBSD: 'GhostBSD',
|
|
||||||
GNU: 'GNU',
|
|
||||||
HAIKU: 'Haiku',
|
|
||||||
HARMONYOS: 'HarmonyOS',
|
|
||||||
HP_UX: 'HP-UX',
|
|
||||||
HURD: 'Hurd',
|
|
||||||
IOS: 'iOS',
|
|
||||||
JOLI: 'Joli',
|
|
||||||
KAIOS: 'KaiOS',
|
|
||||||
LINPUS: 'Linpus',
|
|
||||||
LINSPIRE: 'Linspire',
|
|
||||||
LINUX: 'Linux',
|
|
||||||
MACOS: 'macOS',
|
|
||||||
MAEMO: 'Maemo',
|
|
||||||
MAGEIA: 'Mageia',
|
|
||||||
MANDRIVA: 'Mandriva',
|
|
||||||
MANJARO: 'Manjaro',
|
|
||||||
MEEGO: 'MeeGo',
|
|
||||||
MINIX: 'Minix',
|
|
||||||
MINT: 'Mint',
|
|
||||||
MORPH_OS: 'Morph OS',
|
|
||||||
NETBSD: 'NetBSD',
|
|
||||||
NETRANGE: 'NetRange',
|
|
||||||
NETTV: 'NetTV',
|
|
||||||
NINTENDO: 'Nintendo',
|
|
||||||
OPENBSD: 'OpenBSD',
|
|
||||||
OPENVMS: 'OpenVMS',
|
|
||||||
OS2: 'OS/2',
|
|
||||||
PALM: 'Palm',
|
|
||||||
PC_BSD: 'PC-BSD',
|
|
||||||
PCLINUXOS: 'PCLinuxOS',
|
|
||||||
PLAN9: 'Plan9',
|
|
||||||
PLAYSTATION: 'PlayStation',
|
|
||||||
QNX: 'QNX',
|
|
||||||
RASPBIAN: 'Raspbian',
|
|
||||||
REDHAT: 'RedHat',
|
|
||||||
RIM_TABLET_OS: 'RIM Tablet OS',
|
|
||||||
RISC_OS: 'RISC OS',
|
|
||||||
SABAYON: 'Sabayon',
|
|
||||||
SAILFISH: 'Sailfish',
|
|
||||||
SERENITYOS: 'SerenityOS',
|
|
||||||
SERIES40: 'Series40',
|
|
||||||
SLACKWARE: 'Slackware',
|
|
||||||
SOLARIS: 'Solaris',
|
|
||||||
SUSE: 'SUSE',
|
|
||||||
SYMBIAN: 'Symbian',
|
|
||||||
TIZEN: 'Tizen',
|
|
||||||
UBUNTU: 'Ubuntu',
|
|
||||||
UNIX: 'Unix',
|
|
||||||
VECTORLINUX: 'VectorLinux',
|
|
||||||
VIERA: 'Viera',
|
|
||||||
WATCHOS: 'watchOS',
|
|
||||||
WEBOS: 'WebOS',
|
|
||||||
WINDOWS: 'Windows',
|
|
||||||
WINDOWS_MOBILE: 'Windows Mobile',
|
|
||||||
WINDOWS_PHONE: 'Windows Phone',
|
|
||||||
XBOX: 'Xbox',
|
|
||||||
ZENWALK: 'Zenwalk'
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
Browser,
|
|
||||||
CPU,
|
|
||||||
Device,
|
|
||||||
Vendor,
|
|
||||||
Engine,
|
|
||||||
OS
|
|
||||||
};
|
|
||||||
@@ -1,354 +0,0 @@
|
|||||||
// Generated ESM version of ua-parser-js/enums
|
|
||||||
// DO NOT EDIT THIS FILE!
|
|
||||||
// Source: /src/enums/ua-parser-enums.js
|
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
|
||||||
/* Enums for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
UAParser.js PRO Personal License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
const Browser = Object.freeze({
|
|
||||||
_2345_EXPLORER: '2345Explorer',
|
|
||||||
_360: '360 Browser',
|
|
||||||
ALIPAY: 'Alipay',
|
|
||||||
AMAYA: 'Amaya',
|
|
||||||
ANDROID: 'Android Browser',
|
|
||||||
ARORA: 'Arora',
|
|
||||||
AVANT: 'Avant',
|
|
||||||
AVAST: 'Avast Secure Browser',
|
|
||||||
AVG: 'AVG Secure Browser',
|
|
||||||
BAIDU: 'Baidu Browser',
|
|
||||||
BASILISK: 'Basilisk',
|
|
||||||
BLAZER: 'Blazer',
|
|
||||||
BOLT: 'Bolt',
|
|
||||||
BOWSER: 'Bowser',
|
|
||||||
BRAVE: 'Brave',
|
|
||||||
CAMINO: 'Camino',
|
|
||||||
CHIMERA: 'Chimera',
|
|
||||||
CHROME: 'Chrome',
|
|
||||||
CHROME_HEADLESS: 'Chrome Headless',
|
|
||||||
CHROME_MOBILE: 'Mobile Chrome',
|
|
||||||
CHROME_WEBVIEW: 'Chrome WebView',
|
|
||||||
CHROMIUM: 'Chromium',
|
|
||||||
COBALT: 'Cobalt',
|
|
||||||
COC_COC: 'Coc Coc',
|
|
||||||
COMODO_DRAGON: 'Comodo Dragon',
|
|
||||||
CONKEROR: 'Conkeror',
|
|
||||||
DILLO: 'Dillo',
|
|
||||||
DOLPHIN: 'Dolphin',
|
|
||||||
DORIS: 'Doris',
|
|
||||||
DUCKDUCKGO: 'DuckDuckGo',
|
|
||||||
EDGE: 'Edge',
|
|
||||||
EPIPHANY: 'Epiphany',
|
|
||||||
FACEBOOK: 'Facebook',
|
|
||||||
FALKON: 'Falkon',
|
|
||||||
FIREBIRD: 'Firebird',
|
|
||||||
FIREFOX: 'Firefox',
|
|
||||||
FIREFOX_FOCUS: 'Firefox Focus',
|
|
||||||
FIREFOX_MOBILE: 'Mobile Firefox',
|
|
||||||
FIREFOX_REALITY: 'Firefox Reality',
|
|
||||||
FENNEC: 'Fennec',
|
|
||||||
FLOCK: 'Flock',
|
|
||||||
FLOW: 'Flow',
|
|
||||||
GO: 'Go Browser',
|
|
||||||
GOOGLE_SEARCH: 'GSA',
|
|
||||||
HEYTAP: 'HeyTap',
|
|
||||||
HUAWEI: 'Huawei Browser',
|
|
||||||
ICAB: 'iCab',
|
|
||||||
ICE: 'ICE Browser',
|
|
||||||
ICEAPE: 'IceApe',
|
|
||||||
ICECAT: 'IceCat',
|
|
||||||
ICEDRAGON: 'IceDragon',
|
|
||||||
ICEWEASEL: 'IceWeasel',
|
|
||||||
IE: 'IE',
|
|
||||||
INSTAGRAM: 'Instagram',
|
|
||||||
IRIDIUM: 'Iridium',
|
|
||||||
IRON: 'Iron',
|
|
||||||
JASMINE: 'Jasmine',
|
|
||||||
KONQUEROR: 'Konqueror',
|
|
||||||
KAKAO: 'KakaoTalk',
|
|
||||||
KHTML: 'KHTML',
|
|
||||||
K_MELEON: 'K-Meleon',
|
|
||||||
KLAR: 'Klar',
|
|
||||||
KLARNA: 'Klarna',
|
|
||||||
KINDLE: 'Kindle',
|
|
||||||
LENOVO: 'Smart Lenovo Browser',
|
|
||||||
LIEBAO: 'LBBROWSER',
|
|
||||||
LINE: 'Line',
|
|
||||||
LINKEDIN: 'LinkedIn',
|
|
||||||
LINKS: 'Links',
|
|
||||||
LUNASCAPE: 'Lunascape',
|
|
||||||
LYNX: 'Lynx',
|
|
||||||
MAEMO: 'Maemo Browser',
|
|
||||||
MAXTHON: 'Maxthon',
|
|
||||||
MIDORI: 'Midori',
|
|
||||||
MINIMO: 'Minimo',
|
|
||||||
MIUI: 'MIUI Browser',
|
|
||||||
MOZILLA: 'Mozilla',
|
|
||||||
MOSAIC: 'Mosaic',
|
|
||||||
NAVER: 'Naver',
|
|
||||||
NETFRONT: 'NetFront',
|
|
||||||
NETSCAPE: 'Netscape',
|
|
||||||
NETSURF: 'Netsurf',
|
|
||||||
NOKIA: 'Nokia Browser',
|
|
||||||
OBIGO: 'Obigo',
|
|
||||||
OCULUS: 'Oculus Browser',
|
|
||||||
OMNIWEB: 'OmniWeb',
|
|
||||||
OPERA: 'Opera',
|
|
||||||
OPERA_COAST: 'Opera Coast',
|
|
||||||
OPERA_MINI: 'Opera Mini',
|
|
||||||
OPERA_MOBI: 'Opera Mobi',
|
|
||||||
OPERA_TABLET: 'Opera Tablet',
|
|
||||||
OPERA_TOUCH: 'Opera Touch',
|
|
||||||
OVI: 'OviBrowser',
|
|
||||||
PALEMOON: 'PaleMoon',
|
|
||||||
PHANTOMJS: 'PhantomJS',
|
|
||||||
PHOENIX: 'Phoenix',
|
|
||||||
POLARIS: 'Polaris',
|
|
||||||
PUFFIN: 'Puffin',
|
|
||||||
QQ: 'QQBrowser',
|
|
||||||
QQ_LITE: 'QQBrowserLite',
|
|
||||||
QUARK: 'Quark',
|
|
||||||
QUPZILLA: 'QupZilla',
|
|
||||||
REKONQ: 'rekonq',
|
|
||||||
ROCKMELT: 'Rockmelt',
|
|
||||||
SAFARI: 'Safari',
|
|
||||||
SAFARI_MOBILE: 'Mobile Safari',
|
|
||||||
SAILFISH: 'Sailfish Browser',
|
|
||||||
SAMSUNG: 'Samsung Internet',
|
|
||||||
SEAMONKEY: 'SeaMonkey',
|
|
||||||
SILK: 'Silk',
|
|
||||||
SKYFIRE: 'Skyfire',
|
|
||||||
SLEIPNIR: 'Sleipnir',
|
|
||||||
SLIMBROWSER: 'SlimBrowser',
|
|
||||||
SNAPCHAT: 'Snapchat',
|
|
||||||
SOGOU_EXPLORER: 'Sogou Explorer',
|
|
||||||
SOGOU_MOBILE: 'Sogou Mobile',
|
|
||||||
SWIFTFOX: 'Swiftfox',
|
|
||||||
TESLA: 'Tesla',
|
|
||||||
TIKTOK: 'TikTok',
|
|
||||||
TIZEN: 'Tizen Browser',
|
|
||||||
UC: 'UCBrowser',
|
|
||||||
UP: 'UP.Browser',
|
|
||||||
VIERA: 'Viera',
|
|
||||||
VIVALDI: 'Vivaldi',
|
|
||||||
VIVO: 'Vivo Browser',
|
|
||||||
W3M: 'w3m',
|
|
||||||
WATERFOX: 'Waterfox',
|
|
||||||
WEBKIT: 'WebKit',
|
|
||||||
WECHAT: 'WeChat',
|
|
||||||
WEIBO: 'Weibo',
|
|
||||||
WHALE: 'Whale',
|
|
||||||
YANDEX: 'Yandex'
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
const CPU = Object.freeze({
|
|
||||||
ARM : 'arm',
|
|
||||||
ARM_64: 'arm64',
|
|
||||||
ARM_HF: 'armhf',
|
|
||||||
AVR: 'avr',
|
|
||||||
AVR_32: 'avr32',
|
|
||||||
IA64: 'ia64',
|
|
||||||
IRIX: 'irix',
|
|
||||||
IRIX_64: 'irix64',
|
|
||||||
MIPS: 'mips',
|
|
||||||
MIPS_64: 'mips64',
|
|
||||||
M68K: '68k',
|
|
||||||
PA_RISC: 'pa-risc',
|
|
||||||
PPC: 'ppc',
|
|
||||||
SPARC: 'sparc',
|
|
||||||
SPARC_64: 'sparc64',
|
|
||||||
X86: 'ia32',
|
|
||||||
X86_64: 'amd64'
|
|
||||||
});
|
|
||||||
|
|
||||||
const Device = Object.freeze({
|
|
||||||
CONSOLE: 'console',
|
|
||||||
DESKTOP: 'desktop',
|
|
||||||
EMBEDDED: 'embedded',
|
|
||||||
MOBILE: 'mobile',
|
|
||||||
SMARTTV: 'smarttv',
|
|
||||||
TABLET: 'tablet',
|
|
||||||
WEARABLE: 'wearable'
|
|
||||||
});
|
|
||||||
|
|
||||||
const Vendor = Object.freeze({
|
|
||||||
ACER: 'Acer',
|
|
||||||
ALCATEL: 'Alcatel',
|
|
||||||
APPLE: 'Apple',
|
|
||||||
AMAZON: 'Amazon',
|
|
||||||
ARCHOS: 'Archos',
|
|
||||||
ASUS: 'ASUS',
|
|
||||||
ATT: 'AT&T',
|
|
||||||
BENQ: 'BenQ',
|
|
||||||
BLACKBERRY: 'BlackBerry',
|
|
||||||
DELL: 'Dell',
|
|
||||||
ESSENTIAL: 'Essential',
|
|
||||||
FACEBOOK: 'Facebook',
|
|
||||||
FAIRPHONE: 'Fairphone',
|
|
||||||
GEEKSPHONE: 'GeeksPhone',
|
|
||||||
GENERIC: 'Generic',
|
|
||||||
GOOGLE: 'Google',
|
|
||||||
HP: 'HP',
|
|
||||||
HTC: 'HTC',
|
|
||||||
HUAWEI: 'Huawei',
|
|
||||||
INFINIX: 'Infinix',
|
|
||||||
JOLLA: 'Jolla',
|
|
||||||
KOBO: 'Kobo',
|
|
||||||
LENOVO: 'Lenovo',
|
|
||||||
LG: 'LG',
|
|
||||||
MEIZU: 'Meizu',
|
|
||||||
MICROSOFT: 'Microsoft',
|
|
||||||
MOTOROLA: 'Motorola',
|
|
||||||
NEXIAN: 'Nexian',
|
|
||||||
NINTENDO: 'Nintendo',
|
|
||||||
NOKIA: 'Nokia',
|
|
||||||
NVIDIA: 'Nvidia',
|
|
||||||
ONEPLUS: 'OnePlus',
|
|
||||||
OPPO: 'OPPO',
|
|
||||||
OUYA: 'Ouya',
|
|
||||||
PALM: 'Palm',
|
|
||||||
PANASONIC: 'Panasonic',
|
|
||||||
PEBBLE: 'Pebble',
|
|
||||||
POLYTRON: 'Polytron',
|
|
||||||
REALME: 'Realme',
|
|
||||||
RIM: 'RIM',
|
|
||||||
ROKU: 'Roku',
|
|
||||||
SAMSUNG: 'Samsung',
|
|
||||||
SHARP: 'Sharp',
|
|
||||||
SIEMENS: 'Siemens',
|
|
||||||
SONY: 'Sony',
|
|
||||||
SPRINT: 'Sprint',
|
|
||||||
TECHNISAT: 'TechniSAT',
|
|
||||||
TECNO: 'Tecno',
|
|
||||||
TESLA: 'Tesla',
|
|
||||||
ULEFONE: 'Ulefone',
|
|
||||||
VIVO: 'Vivo',
|
|
||||||
VODAFONE: 'Vodafone',
|
|
||||||
XBOX: 'Xbox',
|
|
||||||
XIAOMI: 'Xiaomi',
|
|
||||||
ZEBRA: 'Zebra',
|
|
||||||
ZTE: 'ZTE',
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
const Engine = Object.freeze({
|
|
||||||
AMAYA: 'Amaya',
|
|
||||||
BLINK: 'Blink',
|
|
||||||
EDGEHTML: 'EdgeHTML',
|
|
||||||
FLOW: 'Flow',
|
|
||||||
GECKO: 'Gecko',
|
|
||||||
GOANNA: 'Goanna',
|
|
||||||
ICAB: 'iCab',
|
|
||||||
KHTML: 'KHTML',
|
|
||||||
LIBWEB: 'LibWeb',
|
|
||||||
LINKS: 'Links',
|
|
||||||
LYNX: 'Lynx',
|
|
||||||
NETFRONT: 'NetFront',
|
|
||||||
NETSURF: 'NetSurf',
|
|
||||||
PRESTO: 'Presto',
|
|
||||||
TASMAN: 'Tasman',
|
|
||||||
TRIDENT: 'Trident',
|
|
||||||
W3M: 'w3m',
|
|
||||||
WEBKIT: 'WebKit'
|
|
||||||
});
|
|
||||||
|
|
||||||
const OS = Object.freeze({
|
|
||||||
AIX: 'AIX',
|
|
||||||
AMIGA_OS: 'Amiga OS',
|
|
||||||
ANDROID: 'Android',
|
|
||||||
ANDROID_X86: 'Android-x86',
|
|
||||||
ARCH: 'Arch',
|
|
||||||
BADA: 'Bada',
|
|
||||||
BEOS: 'BeOS',
|
|
||||||
BLACKBERRY: 'BlackBerry',
|
|
||||||
CENTOS: 'CentOS',
|
|
||||||
CHROME_OS: 'Chrome OS',
|
|
||||||
CHROMECAST: 'Chromecast',
|
|
||||||
CONTIKI: 'Contiki',
|
|
||||||
DEBIAN: 'Debian',
|
|
||||||
DEEPIN: 'Deepin',
|
|
||||||
DRAGONFLY: 'DragonFly',
|
|
||||||
ELEMENTARY_OS: 'elementary OS',
|
|
||||||
FEDORA: 'Fedora',
|
|
||||||
FIREFOX_OS: 'Firefox OS',
|
|
||||||
FREEBSD: 'FreeBSD',
|
|
||||||
FUCHSIA: 'Fuchsia',
|
|
||||||
GENTOO: 'Gentoo',
|
|
||||||
GHOSTBSD: 'GhostBSD',
|
|
||||||
GNU: 'GNU',
|
|
||||||
HAIKU: 'Haiku',
|
|
||||||
HARMONYOS: 'HarmonyOS',
|
|
||||||
HP_UX: 'HP-UX',
|
|
||||||
HURD: 'Hurd',
|
|
||||||
IOS: 'iOS',
|
|
||||||
JOLI: 'Joli',
|
|
||||||
KAIOS: 'KaiOS',
|
|
||||||
LINPUS: 'Linpus',
|
|
||||||
LINSPIRE: 'Linspire',
|
|
||||||
LINUX: 'Linux',
|
|
||||||
MACOS: 'macOS',
|
|
||||||
MAEMO: 'Maemo',
|
|
||||||
MAGEIA: 'Mageia',
|
|
||||||
MANDRIVA: 'Mandriva',
|
|
||||||
MANJARO: 'Manjaro',
|
|
||||||
MEEGO: 'MeeGo',
|
|
||||||
MINIX: 'Minix',
|
|
||||||
MINT: 'Mint',
|
|
||||||
MORPH_OS: 'Morph OS',
|
|
||||||
NETBSD: 'NetBSD',
|
|
||||||
NETRANGE: 'NetRange',
|
|
||||||
NETTV: 'NetTV',
|
|
||||||
NINTENDO: 'Nintendo',
|
|
||||||
OPENBSD: 'OpenBSD',
|
|
||||||
OPENVMS: 'OpenVMS',
|
|
||||||
OS2: 'OS/2',
|
|
||||||
PALM: 'Palm',
|
|
||||||
PC_BSD: 'PC-BSD',
|
|
||||||
PCLINUXOS: 'PCLinuxOS',
|
|
||||||
PLAN9: 'Plan9',
|
|
||||||
PLAYSTATION: 'PlayStation',
|
|
||||||
QNX: 'QNX',
|
|
||||||
RASPBIAN: 'Raspbian',
|
|
||||||
REDHAT: 'RedHat',
|
|
||||||
RIM_TABLET_OS: 'RIM Tablet OS',
|
|
||||||
RISC_OS: 'RISC OS',
|
|
||||||
SABAYON: 'Sabayon',
|
|
||||||
SAILFISH: 'Sailfish',
|
|
||||||
SERENITYOS: 'SerenityOS',
|
|
||||||
SERIES40: 'Series40',
|
|
||||||
SLACKWARE: 'Slackware',
|
|
||||||
SOLARIS: 'Solaris',
|
|
||||||
SUSE: 'SUSE',
|
|
||||||
SYMBIAN: 'Symbian',
|
|
||||||
TIZEN: 'Tizen',
|
|
||||||
UBUNTU: 'Ubuntu',
|
|
||||||
UNIX: 'Unix',
|
|
||||||
VECTORLINUX: 'VectorLinux',
|
|
||||||
VIERA: 'Viera',
|
|
||||||
WATCHOS: 'watchOS',
|
|
||||||
WEBOS: 'WebOS',
|
|
||||||
WINDOWS: 'Windows',
|
|
||||||
WINDOWS_MOBILE: 'Windows Mobile',
|
|
||||||
WINDOWS_PHONE: 'Windows Phone',
|
|
||||||
XBOX: 'Xbox',
|
|
||||||
ZENWALK: 'Zenwalk'
|
|
||||||
|
|
||||||
// TODO : test!
|
|
||||||
});
|
|
||||||
|
|
||||||
export {
|
|
||||||
Browser,
|
|
||||||
CPU,
|
|
||||||
Device,
|
|
||||||
Vendor,
|
|
||||||
Engine,
|
|
||||||
OS
|
|
||||||
};
|
|
||||||
13
src/extensions/ua-parser-extensions.d.ts
vendored
13
src/extensions/ua-parser-extensions.d.ts
vendored
@@ -1,13 +0,0 @@
|
|||||||
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.2
|
|
||||||
// Project: https://github.com/faisalman/ua-parser-js
|
|
||||||
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
|
||||||
|
|
||||||
import type { UAParserExt } from "../main/ua-parser";
|
|
||||||
|
|
||||||
export const Apps: UAParserExt;
|
|
||||||
export const Bots: UAParserExt;
|
|
||||||
export const CLIs: UAParserExt;
|
|
||||||
export const ExtraDevices: UAParserExt;
|
|
||||||
export const Emails: UAParserExt;
|
|
||||||
export const MediaPlayers: UAParserExt;
|
|
||||||
export const Modules: UAParserExt;
|
|
||||||
@@ -1,248 +0,0 @@
|
|||||||
///////////////////////////////////////////////
|
|
||||||
/* Extensions for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
UAParser.js PRO Personal License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
const MODEL = 'model';
|
|
||||||
const NAME = 'name';
|
|
||||||
const TYPE = 'type';
|
|
||||||
const VENDOR = 'vendor';
|
|
||||||
const VERSION = 'version';
|
|
||||||
const MOBILE = 'mobile';
|
|
||||||
const TABLET = 'tablet';
|
|
||||||
|
|
||||||
const Apps = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
[/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, 'app']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Bots = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Googlebot / BingBot / MSNBot / FacebookBot
|
|
||||||
[/((?:google|bing|msn|facebook)bot(?:[\-imagevdo]{0,6})|bingpreview)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],
|
|
||||||
|
|
||||||
// GPTBot - https://platform.openai.com/docs/gptbot
|
|
||||||
[/(gptbot)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],
|
|
||||||
|
|
||||||
// Slackbot - https://api.slack.com/robots
|
|
||||||
[/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const CLIs = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// wget / curl / lynx
|
|
||||||
[/(wget|curl|lynx)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'cli']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const ExtraDevices = Object.freeze({
|
|
||||||
device : [[
|
|
||||||
/(nook)[\w ]+build\/(\w+)/i, // Nook
|
|
||||||
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
|
|
||||||
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
|
|
||||||
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
|
|
||||||
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
|
|
||||||
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
|
|
||||||
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/(u304aa)/i // AT&T
|
|
||||||
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\bsie-(\w*)/i // Siemens
|
|
||||||
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(rct\w+) b/i // RCA Tablets
|
|
||||||
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(tm\d{3}\w+) b/i
|
|
||||||
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(k88) b/i // ZTE K Series Tablet
|
|
||||||
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(nx\d{3}j) b/i // ZTE Nubia
|
|
||||||
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
|
|
||||||
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(zur\d{3}) b/i // Swiss ZUR Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b((zeki)?tb.*\b) b/i // Zeki Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b([yr]\d{2}) b/i,
|
|
||||||
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(ns-?\w{0,9}) b/i // Insignia Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
|
|
||||||
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
|
|
||||||
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
|
|
||||||
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(ph-1) /i // Essential PH-1
|
|
||||||
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
|
|
||||||
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\btu_(1491) b/i // Rotor Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Emails = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Microsoft Outlook / Thunderbird
|
|
||||||
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, 'email']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const MediaPlayers = Object.freeze({
|
|
||||||
browser : [[
|
|
||||||
|
|
||||||
/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
|
|
||||||
/(coremedia) v([\w\._]+)/i
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
|
|
||||||
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
|
|
||||||
// NSPlayer/PSP-InternetRadioPlayer/Videos
|
|
||||||
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
|
|
||||||
/(lg player|nexplayer)\s([\d\.]+)/i,
|
|
||||||
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(flrp)\/([\w\.-]+)/i // Flip Player
|
|
||||||
], [[NAME, 'Flip Player'], VERSION], [
|
|
||||||
|
|
||||||
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
|
|
||||||
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
|
|
||||||
// Gstreamer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
|
|
||||||
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
|
|
||||||
// Java/urllib/requests/wget/cURL
|
|
||||||
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(htc_one_s)\/([\d\.]+)/i, // HTC One S
|
|
||||||
], [[NAME, /_/g, ' '], VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
|
|
||||||
// MPlayer SVN
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
|
|
||||||
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)/i, // MPlayer (no other info)
|
|
||||||
/(yourmuze)/i, // YourMuze
|
|
||||||
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(nokia\d+)\/([\w\.-]+)/i // Nokia
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(winamp)3 version ([\w\.-]+)/i, // Winamp
|
|
||||||
/(winamp)\s([\w\.-]+)/i,
|
|
||||||
/(winamp)mpeg\/([\w\.-]+)/i
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
|
|
||||||
// inlight radio
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i
|
|
||||||
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
|
|
||||||
// SoundTap/Totem/Stagefright/Streamium
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(smp)([\d\.]+)/i // SMP
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
|
|
||||||
/(vlc)\/([\w\.-]+)/i,
|
|
||||||
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
|
|
||||||
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
|
|
||||||
/(itunes)\/([\d\.]+)/i // iTunes
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
|
|
||||||
/(windows-media-player)\/([\w\.-]+)/i
|
|
||||||
], [[NAME, /-/g, ' '], VERSION], [
|
|
||||||
|
|
||||||
/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
|
|
||||||
// Windows Media Server
|
|
||||||
], [VERSION, [NAME, 'Windows']], [
|
|
||||||
|
|
||||||
/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(rad.io)\s([\d\.]+)/i, // Rad.io
|
|
||||||
/(radio.(?:de|at|fr))\s([\d\.]+)/i
|
|
||||||
], [[NAME, 'rad.io'], VERSION]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Modules = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Axios/jsdom/Scrapy
|
|
||||||
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'module']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
Apps,
|
|
||||||
Bots,
|
|
||||||
CLIs,
|
|
||||||
ExtraDevices,
|
|
||||||
Emails,
|
|
||||||
MediaPlayers,
|
|
||||||
Modules
|
|
||||||
};
|
|
||||||
@@ -1,252 +0,0 @@
|
|||||||
// Generated ESM version of ua-parser-js/extensions
|
|
||||||
// DO NOT EDIT THIS FILE!
|
|
||||||
// Source: /src/extensions/ua-parser-extensions.js
|
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
|
||||||
/* Extensions for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
UAParser.js PRO Personal License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
const MODEL = 'model';
|
|
||||||
const NAME = 'name';
|
|
||||||
const TYPE = 'type';
|
|
||||||
const VENDOR = 'vendor';
|
|
||||||
const VERSION = 'version';
|
|
||||||
const MOBILE = 'mobile';
|
|
||||||
const TABLET = 'tablet';
|
|
||||||
|
|
||||||
const Apps = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
[/chatlyio\/([\d\.]+)/i], [VERSION, 'Slack', [TYPE, 'app']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Bots = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Googlebot / BingBot / MSNBot / FacebookBot
|
|
||||||
[/((?:google|bing|msn|facebook)bot(?:[\-imagevdo]{0,6})|bingpreview)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],
|
|
||||||
|
|
||||||
// GPTBot - https://platform.openai.com/docs/gptbot
|
|
||||||
[/(gptbot)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']],
|
|
||||||
|
|
||||||
// Slackbot - https://api.slack.com/robots
|
|
||||||
[/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i], [NAME, VERSION, [TYPE, 'bot']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const CLIs = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// wget / curl / lynx
|
|
||||||
[/(wget|curl|lynx)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'cli']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const ExtraDevices = Object.freeze({
|
|
||||||
device : [[
|
|
||||||
/(nook)[\w ]+build\/(\w+)/i, // Nook
|
|
||||||
/(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak
|
|
||||||
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets
|
|
||||||
/(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets
|
|
||||||
/(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets
|
|
||||||
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
|
|
||||||
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/(u304aa)/i // AT&T
|
|
||||||
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\bsie-(\w*)/i // Siemens
|
|
||||||
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(rct\w+) b/i // RCA Tablets
|
|
||||||
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(tm\d{3}\w+) b/i
|
|
||||||
], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(k88) b/i // ZTE K Series Tablet
|
|
||||||
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(nx\d{3}j) b/i // ZTE Nubia
|
|
||||||
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
|
|
||||||
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(zur\d{3}) b/i // Swiss ZUR Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b((zeki)?tb.*\b) b/i // Zeki Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b([yr]\d{2}) b/i,
|
|
||||||
/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
|
|
||||||
], [MODEL, [VENDOR, 'Dragon Touch'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(ns-?\w{0,9}) b/i // Insignia Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
|
|
||||||
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
|
|
||||||
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
|
|
||||||
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(ph-1) /i // Essential PH-1
|
|
||||||
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [
|
|
||||||
|
|
||||||
/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
|
|
||||||
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [
|
|
||||||
|
|
||||||
/\btu_(1491) b/i // Rotor Tablets
|
|
||||||
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Emails = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Microsoft Outlook / Thunderbird
|
|
||||||
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, 'email']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const MediaPlayers = Object.freeze({
|
|
||||||
browser : [[
|
|
||||||
|
|
||||||
/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
|
|
||||||
/(coremedia) v([\w\._]+)/i
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
|
|
||||||
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
|
|
||||||
// NSPlayer/PSP-InternetRadioPlayer/Videos
|
|
||||||
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
|
|
||||||
/(lg player|nexplayer)\s([\d\.]+)/i,
|
|
||||||
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(flrp)\/([\w\.-]+)/i // Flip Player
|
|
||||||
], [[NAME, 'Flip Player'], VERSION], [
|
|
||||||
|
|
||||||
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
|
|
||||||
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
|
|
||||||
// Gstreamer
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
|
|
||||||
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
|
|
||||||
// Java/urllib/requests/wget/cURL
|
|
||||||
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(htc_one_s)\/([\d\.]+)/i, // HTC One S
|
|
||||||
], [[NAME, /_/g, ' '], VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
|
|
||||||
// MPlayer SVN
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
|
|
||||||
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(mplayer)/i, // MPlayer (no other info)
|
|
||||||
/(yourmuze)/i, // YourMuze
|
|
||||||
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(nokia\d+)\/([\w\.-]+)/i // Nokia
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(winamp)3 version ([\w\.-]+)/i, // Winamp
|
|
||||||
/(winamp)\s([\w\.-]+)/i,
|
|
||||||
/(winamp)mpeg\/([\w\.-]+)/i
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
|
|
||||||
// inlight radio
|
|
||||||
], [NAME], [
|
|
||||||
|
|
||||||
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i
|
|
||||||
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
|
|
||||||
// SoundTap/Totem/Stagefright/Streamium
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(smp)([\d\.]+)/i // SMP
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
|
|
||||||
/(vlc)\/([\w\.-]+)/i,
|
|
||||||
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
|
|
||||||
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
|
|
||||||
/(itunes)\/([\d\.]+)/i // iTunes
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
|
|
||||||
/(windows-media-player)\/([\w\.-]+)/i
|
|
||||||
], [[NAME, /-/g, ' '], VERSION], [
|
|
||||||
|
|
||||||
/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
|
|
||||||
// Windows Media Server
|
|
||||||
], [VERSION, [NAME, 'Windows']], [
|
|
||||||
|
|
||||||
/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
|
|
||||||
], [NAME, VERSION], [
|
|
||||||
|
|
||||||
/(rad.io)\s([\d\.]+)/i, // Rad.io
|
|
||||||
/(radio.(?:de|at|fr))\s([\d\.]+)/i
|
|
||||||
], [[NAME, 'rad.io'], VERSION]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const Modules = Object.freeze({
|
|
||||||
browser : [
|
|
||||||
// Axios/jsdom/Scrapy
|
|
||||||
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, 'module']]
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
export {
|
|
||||||
Apps,
|
|
||||||
Bots,
|
|
||||||
CLIs,
|
|
||||||
ExtraDevices,
|
|
||||||
Emails,
|
|
||||||
MediaPlayers,
|
|
||||||
Modules
|
|
||||||
};
|
|
||||||
15
src/helpers/ua-parser-helpers.d.ts
vendored
15
src/helpers/ua-parser-helpers.d.ts
vendored
@@ -1,15 +0,0 @@
|
|||||||
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.2
|
|
||||||
// Project: https://github.com/faisalman/ua-parser-js
|
|
||||||
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
|
||||||
|
|
||||||
import { IResult } from "../main/ua-parser";
|
|
||||||
|
|
||||||
declare function isAppleSilicon(res: IResult): boolean;
|
|
||||||
declare function isChromiumBased(res: IResult): boolean;
|
|
||||||
declare function isFrozenUA(ua: string): boolean;
|
|
||||||
|
|
||||||
export {
|
|
||||||
isAppleSilicon,
|
|
||||||
isChromiumBased,
|
|
||||||
isFrozenUA
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
///////////////////////////////////////////////
|
|
||||||
/* Helpers for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
AGPLv3 License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
const { CPU, OS, Engine } = require('../enums/ua-parser-enums');
|
|
||||||
|
|
||||||
const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM);
|
|
||||||
|
|
||||||
const isChromiumBased = (res) => res.engine.is(Engine.BLINK);
|
|
||||||
|
|
||||||
const isFrozenUA = (ua) => /^Mozilla\/5\.0 \((Windows NT 10\.0; Win64; x64|Macintosh; Intel Mac OS X 10_15_7|X11; Linux x86_64|X11; CrOS x86_64 14541\.0\.0|Fuchsia|Linux; Android 10; K)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/\d+\.0\.0\.0 (Mobile )?Safari\/537\.36/.test(ua);
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
isAppleSilicon,
|
|
||||||
isChromiumBased,
|
|
||||||
isFrozenUA
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
// Generated ESM version of ua-parser-js/helpers
|
|
||||||
// DO NOT EDIT THIS FILE!
|
|
||||||
// Source: /src/helpers/ua-parser-helpers.js
|
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
|
||||||
/* Helpers for UAParser.js v2.0.0-beta.2
|
|
||||||
https://github.com/faisalman/ua-parser-js
|
|
||||||
Author: Faisal Salman <f@faisalman.com>
|
|
||||||
AGPLv3 License */
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
import { CPU, OS, Engine } from '../enums/ua-parser-enums';
|
|
||||||
|
|
||||||
const isAppleSilicon = (res) => res.os.is(OS.MACOS) && res.cpu.is(CPU.ARM);
|
|
||||||
|
|
||||||
const isChromiumBased = (res) => res.engine.is(Engine.BLINK);
|
|
||||||
|
|
||||||
const isFrozenUA = (ua) => /^Mozilla\/5\.0 \((Windows NT 10\.0; Win64; x64|Macintosh; Intel Mac OS X 10_15_7|X11; Linux x86_64|X11; CrOS x86_64 14541\.0\.0|Fuchsia|Linux; Android 10; K)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/\d+\.0\.0\.0 (Mobile )?Safari\/537\.36/.test(ua);
|
|
||||||
|
|
||||||
export {
|
|
||||||
isAppleSilicon,
|
|
||||||
isChromiumBased,
|
|
||||||
isFrozenUA
|
|
||||||
}
|
|
||||||
106
src/main/ua-parser.d.ts
vendored
106
src/main/ua-parser.d.ts
vendored
@@ -1,106 +0,0 @@
|
|||||||
// Type definitions for UAParser.js v2.0.0-beta.2
|
|
||||||
// Project: https://github.com/faisalman/ua-parser-js
|
|
||||||
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
|
||||||
|
|
||||||
declare namespace UAParser {
|
|
||||||
|
|
||||||
interface IData<T> {
|
|
||||||
is(val: string): boolean;
|
|
||||||
toString(): string;
|
|
||||||
withClientHints(): PromiseLike<T> | T;
|
|
||||||
withFeatureCheck(): T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IBrowser extends IData<IBrowser> {
|
|
||||||
name?: string;
|
|
||||||
version?: string;
|
|
||||||
major?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ICPU extends IData<ICPU> {
|
|
||||||
architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'ppc' | 'sparc' | 'sparc64';
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IDevice extends IData<IDevice> {
|
|
||||||
type?: 'mobile' | 'tablet' | 'console' | 'smarttv' | 'wearable';
|
|
||||||
vendor?: string;
|
|
||||||
model?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IEngine extends IData<IEngine> {
|
|
||||||
name?: 'Amaya' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit';
|
|
||||||
version?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IOS extends IData<IOS> {
|
|
||||||
name?: string;
|
|
||||||
version?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IResult extends IData<IResult> {
|
|
||||||
ua: string;
|
|
||||||
browser: IBrowser;
|
|
||||||
cpu: ICPU;
|
|
||||||
device: IDevice;
|
|
||||||
engine: IEngine;
|
|
||||||
os: IOS;
|
|
||||||
}
|
|
||||||
|
|
||||||
type RegexMap = ((RegExp | string | (string | RegExp | Function)[])[])[];
|
|
||||||
type UAParserProps = 'browser' | 'cpu' | 'device' | 'engine' | 'os';
|
|
||||||
type UAParserExt = Partial<Record<UAParserProps, RegexMap>>;
|
|
||||||
|
|
||||||
export function UAParser(uastring?: string, extensions?: UAParserExt, headers?: Record<string, string>): IResult;
|
|
||||||
export function UAParser(uastring?: string, headers?: Record<string, string>): IResult;
|
|
||||||
export function UAParser(extensions?: UAParserExt, headers?: Record<string, string>): IResult;
|
|
||||||
export function UAParser(headers?: Record<string, string>): IResult;
|
|
||||||
|
|
||||||
export class UAParser {
|
|
||||||
|
|
||||||
static readonly BROWSER: {
|
|
||||||
NAME: 'name';
|
|
||||||
VERSION: 'version';
|
|
||||||
MAJOR: 'major';
|
|
||||||
};
|
|
||||||
static readonly CPU: {
|
|
||||||
ARCHITECTURE: 'architecture';
|
|
||||||
};
|
|
||||||
static readonly DEVICE: {
|
|
||||||
TYPE: 'type';
|
|
||||||
VENDOR: 'vendor';
|
|
||||||
MODEL: 'model';
|
|
||||||
CONSOLE: 'console';
|
|
||||||
MOBILE: 'mobile';
|
|
||||||
SMARTTV: 'smarttv';
|
|
||||||
TABLET: 'tablet';
|
|
||||||
WEARABLE: 'wearable';
|
|
||||||
EMBEDDED: 'embedded';
|
|
||||||
};
|
|
||||||
static readonly ENGINE: {
|
|
||||||
NAME: 'name';
|
|
||||||
VERSION: 'version';
|
|
||||||
};
|
|
||||||
static readonly OS: {
|
|
||||||
NAME: 'name';
|
|
||||||
VERSION: 'version';
|
|
||||||
};
|
|
||||||
static readonly VERSION: string;
|
|
||||||
|
|
||||||
constructor(uastring?: string, extensions?: UAParserExt, headers?: Record<string, string>);
|
|
||||||
constructor(uastring?: string, headers?: Record<string, string>);
|
|
||||||
constructor(extensions?: UAParserExt, headers?: Record<string, string>);
|
|
||||||
constructor(headers?: Record<string, string>);
|
|
||||||
|
|
||||||
getUA(): string;
|
|
||||||
getBrowser(): IBrowser;
|
|
||||||
getCPU(): ICPU;
|
|
||||||
getDevice(): IDevice;
|
|
||||||
getEngine(): IEngine;
|
|
||||||
getOS(): IOS;
|
|
||||||
getResult(): IResult;
|
|
||||||
setUA(uastring: string): UAParser;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export as namespace UAParser;
|
|
||||||
export = UAParser;
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
675
src/ua-parser.js
Normal file
675
src/ua-parser.js
Normal file
@@ -0,0 +1,675 @@
|
|||||||
|
// UAParser.js v0.7.0
|
||||||
|
// Lightweight JavaScript-based User-Agent string parser
|
||||||
|
// https://github.com/faisalman/ua-parser-js
|
||||||
|
//
|
||||||
|
// Copyright © 2012-2013 Faisalman <fyzlman@gmail.com>
|
||||||
|
// Dual licensed under GPLv2 & MIT
|
||||||
|
|
||||||
|
(function (window, undefined) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
//////////////
|
||||||
|
// Constants
|
||||||
|
/////////////
|
||||||
|
|
||||||
|
|
||||||
|
var EMPTY = '',
|
||||||
|
UNKNOWN = '?',
|
||||||
|
FUNC_TYPE = 'function',
|
||||||
|
UNDEF_TYPE = 'undefined',
|
||||||
|
OBJ_TYPE = 'object',
|
||||||
|
MAJOR = 'major',
|
||||||
|
MODEL = 'model',
|
||||||
|
NAME = 'name',
|
||||||
|
TYPE = 'type',
|
||||||
|
VENDOR = 'vendor',
|
||||||
|
VERSION = 'version',
|
||||||
|
ARCHITECTURE= 'architecture',
|
||||||
|
CONSOLE = 'console',
|
||||||
|
MOBILE = 'mobile',
|
||||||
|
TABLET = 'tablet',
|
||||||
|
SMARTTV = 'smarttv';
|
||||||
|
|
||||||
|
|
||||||
|
///////////
|
||||||
|
// Helper
|
||||||
|
//////////
|
||||||
|
|
||||||
|
|
||||||
|
var util = {
|
||||||
|
has : function (str1, str2) {
|
||||||
|
if (typeof str1 === "string") {
|
||||||
|
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lowerize : function (str) {
|
||||||
|
return str.toLowerCase();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///////////////
|
||||||
|
// Map helper
|
||||||
|
//////////////
|
||||||
|
|
||||||
|
|
||||||
|
var mapper = {
|
||||||
|
|
||||||
|
rgx : function () {
|
||||||
|
|
||||||
|
// loop through all regexes maps
|
||||||
|
for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) {
|
||||||
|
|
||||||
|
var regex = args[i], // even sequence (0,2,4,..)
|
||||||
|
props = args[i + 1]; // odd sequence (1,3,5,..)
|
||||||
|
|
||||||
|
// construct object barebones
|
||||||
|
if (typeof(result) === UNDEF_TYPE) {
|
||||||
|
result = {};
|
||||||
|
for (p in props) {
|
||||||
|
q = props[p];
|
||||||
|
if (typeof(q) === OBJ_TYPE) {
|
||||||
|
result[q[0]] = undefined;
|
||||||
|
} else {
|
||||||
|
result[q] = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try matching uastring with regexes
|
||||||
|
for (j = k = 0; j < regex.length; j++) {
|
||||||
|
matches = regex[j].exec(this.getUA());
|
||||||
|
if (!!matches) {
|
||||||
|
for (p = 0; p < props.length; p++) {
|
||||||
|
match = matches[++k];
|
||||||
|
q = props[p];
|
||||||
|
// check if given property is actually array
|
||||||
|
if (typeof(q) === OBJ_TYPE && q.length > 0) {
|
||||||
|
if (q.length == 2) {
|
||||||
|
if (typeof(q[1]) == FUNC_TYPE) {
|
||||||
|
// assign modified match
|
||||||
|
result[q[0]] = q[1].call(this, match);
|
||||||
|
} else {
|
||||||
|
// assign given value, ignore regex match
|
||||||
|
result[q[0]] = q[1];
|
||||||
|
}
|
||||||
|
} else if (q.length == 3) {
|
||||||
|
// check whether function or regex
|
||||||
|
if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) {
|
||||||
|
// call function (usually string mapper)
|
||||||
|
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
|
||||||
|
} else {
|
||||||
|
// sanitize match using given regex
|
||||||
|
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
|
||||||
|
}
|
||||||
|
} else if (q.length == 4) {
|
||||||
|
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result[q] = match ? match : undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!!matches) break; // break the loop immediately if match found
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
str : function (str, map) {
|
||||||
|
|
||||||
|
for (var i in map) {
|
||||||
|
// check if array
|
||||||
|
if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) {
|
||||||
|
for (var j = 0; j < map[i].length; j++) {
|
||||||
|
if (util.has(map[i][j], str)) {
|
||||||
|
return (i === UNKNOWN) ? undefined : i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (util.has(map[i], str)) {
|
||||||
|
return (i === UNKNOWN) ? undefined : i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///////////////
|
||||||
|
// String map
|
||||||
|
//////////////
|
||||||
|
|
||||||
|
|
||||||
|
var maps = {
|
||||||
|
|
||||||
|
browser : {
|
||||||
|
oldsafari : {
|
||||||
|
major : {
|
||||||
|
'1' : ['/8', '/1', '/3'],
|
||||||
|
'2' : '/4',
|
||||||
|
'?' : '/'
|
||||||
|
},
|
||||||
|
version : {
|
||||||
|
'1.0' : '/8',
|
||||||
|
'1.2' : '/1',
|
||||||
|
'1.3' : '/3',
|
||||||
|
'2.0' : '/412',
|
||||||
|
'2.0.2' : '/416',
|
||||||
|
'2.0.3' : '/417',
|
||||||
|
'2.0.4' : '/419',
|
||||||
|
'?' : '/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
device : {
|
||||||
|
sprint : {
|
||||||
|
model : {
|
||||||
|
'Evo Shift 4G' : '7373KT'
|
||||||
|
},
|
||||||
|
vendor : {
|
||||||
|
'HTC' : 'APA',
|
||||||
|
'Sprint' : 'Sprint'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
os : {
|
||||||
|
windows : {
|
||||||
|
version : {
|
||||||
|
'ME' : '4.90',
|
||||||
|
'NT 3.11' : 'NT3.51',
|
||||||
|
'NT 4.0' : 'NT4.0',
|
||||||
|
'2000' : 'NT 5.0',
|
||||||
|
'XP' : ['NT 5.1', 'NT 5.2'],
|
||||||
|
'Vista' : 'NT 6.0',
|
||||||
|
'7' : 'NT 6.1',
|
||||||
|
'8' : 'NT 6.2',
|
||||||
|
'8.1' : 'NT 6.3',
|
||||||
|
'RT' : 'ARM'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//////////////
|
||||||
|
// Regex map
|
||||||
|
/////////////
|
||||||
|
|
||||||
|
|
||||||
|
var regexes = {
|
||||||
|
|
||||||
|
browser : [[
|
||||||
|
|
||||||
|
/APP-([\w\s-\d]+)\/((\d+)?[\w\.]+)/i // KTA App
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
// Presto based
|
||||||
|
/(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini
|
||||||
|
/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet
|
||||||
|
/(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80
|
||||||
|
/(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80
|
||||||
|
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit
|
||||||
|
], [[NAME, 'Opera'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
// Mixed
|
||||||
|
/(kindle)\/((\d+)?[\w\.]+)/i, // Kindle
|
||||||
|
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
|
||||||
|
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
||||||
|
|
||||||
|
// Trident based
|
||||||
|
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
|
||||||
|
// Avant/IEMobile/SlimBrowser/Baidu
|
||||||
|
/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
|
||||||
|
|
||||||
|
// Webkit/KHTML based
|
||||||
|
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
|
||||||
|
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
|
||||||
|
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11
|
||||||
|
], [[NAME, 'IE'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex
|
||||||
|
], [[NAME, 'Yandex'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon
|
||||||
|
], [[NAME, /_/g, ' '], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i
|
||||||
|
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin
|
||||||
|
], [[NAME, 'Dolphin'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS
|
||||||
|
], [[NAME, 'Chrome'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
|
||||||
|
], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [
|
||||||
|
|
||||||
|
/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
|
||||||
|
], [VERSION, MAJOR, NAME], [
|
||||||
|
|
||||||
|
/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0
|
||||||
|
], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [
|
||||||
|
|
||||||
|
/(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror
|
||||||
|
/(webkit|khtml)\/((\d+)?[\w\.]+)/i
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
// Gecko based
|
||||||
|
/(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape
|
||||||
|
], [[NAME, 'Netscape'], VERSION, MAJOR], [
|
||||||
|
/(swiftfox)/i, // Swiftfox
|
||||||
|
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
|
||||||
|
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
||||||
|
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
|
||||||
|
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
||||||
|
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
|
||||||
|
|
||||||
|
// Other
|
||||||
|
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
|
||||||
|
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser
|
||||||
|
/(links)\s\(((\d+)?[\w\.]+)/i, // Links
|
||||||
|
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser
|
||||||
|
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser
|
||||||
|
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, // Generic Apple CoreMedia
|
||||||
|
/(coremedia) v((\d+)[\w\._]+)/i
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(aqualung|lyssna|bsplayer)\/((\d+)?[\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(ares|ossproxy)\s((\d+)[\w\.-]+)/i // Ares/OSSProxy
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
|
||||||
|
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
|
||||||
|
// NSPlayer/PSP-InternetRadioPlayer/Videos
|
||||||
|
/(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, // Clementine/MPD
|
||||||
|
/(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
|
||||||
|
/player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i // NexPlayer/LG Player
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
/(nexplayer)\s((\d+)[\w\.-]+)/i // Nexplayer
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(flrp)\/((\d+)[\w\.-]+)/i // Flip Player
|
||||||
|
], [[NAME, 'Flip Player'], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
|
||||||
|
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
|
||||||
|
], [NAME], [
|
||||||
|
|
||||||
|
/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i
|
||||||
|
// Gstreamer
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, // HTC Streaming Player
|
||||||
|
/(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
|
||||||
|
// Java/urllib/requests/wget/cURL
|
||||||
|
/(lavf)((\d+)[\d\.]+)/i // Lavf (FFMPEG)
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(htc_one_s)\/((\d+)[\d\.]+)/i, // HTC One S
|
||||||
|
], [[NAME, /_/g, ' '], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i,
|
||||||
|
// MPlayer SVN
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(mplayer)(?:\s|\/|[unkow-]+)((\d+)[\w\.-]+)/i, // MPlayer
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(mplayer)/i, // MPlayer (no other info)
|
||||||
|
/(yourmuze)/i, // YourMuze
|
||||||
|
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
|
||||||
|
], [NAME], [
|
||||||
|
|
||||||
|
/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i // Nero Home/Nero Scout
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(nokia\d+)\/((\d+)[\w\.-]+)/i // Nokia
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/\s(songbird)\/((\d+)[\w\.-]+)/i // Songbird/Philips-Songbird
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(winamp)3 version ((\d+)[\w\.-]+)/i, // Winamp
|
||||||
|
/(winamp)\s((\d+)[\w\.-]+)/i,
|
||||||
|
/(winamp)mpeg\/((\d+)[\w\.-]+)/i
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
|
||||||
|
// inlight radio
|
||||||
|
], [NAME], [
|
||||||
|
|
||||||
|
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i
|
||||||
|
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
|
||||||
|
// SoundTap/Totem/Stagefright/Streamium
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(smp)((\d+)[\d\.]+)/i // SMP
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(vlc) media player - version ((\d+)[\w\.]+)/i, // VLC Videolan
|
||||||
|
/(vlc)\/((\d+)[\w\.-]+)/i,
|
||||||
|
/(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
|
||||||
|
/(foobar2000)\/((\d+)[\d\.]+)/i, // Foobar2000
|
||||||
|
/(itunes)\/((\d+)[\d\.]+)/i // iTunes
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(wmplayer)\/((\d+)[\w\.-]+)/i, // Windows Media Player
|
||||||
|
/(windows-media-player)\/((\d+)[\w\.-]+)/i
|
||||||
|
], [[NAME, /-/g, ' '], VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
|
||||||
|
// Windows Media Server
|
||||||
|
], [VERSION, MAJOR, [NAME, 'Windows']], [
|
||||||
|
|
||||||
|
/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i // RiseUP Radio Alarm
|
||||||
|
], [NAME, VERSION, MAJOR], [
|
||||||
|
|
||||||
|
/(rad.io)\s((\d+)[\d\.]+)/i, // Rad.io
|
||||||
|
/(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i
|
||||||
|
], [[NAME, 'rad.io'], VERSION, MAJOR]
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
cpu : [[
|
||||||
|
|
||||||
|
/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64
|
||||||
|
], [[ARCHITECTURE, 'amd64']], [
|
||||||
|
|
||||||
|
/(ia32(?=;))/i // IA32 (quicktime)
|
||||||
|
], [[ARCHITECTURE, util.lowerize]], [
|
||||||
|
|
||||||
|
/((?:i[346]|x)86)[;\)]/i // IA32
|
||||||
|
], [[ARCHITECTURE, 'ia32']], [
|
||||||
|
|
||||||
|
// PocketPC mistakenly identified as PowerPC
|
||||||
|
/windows\s(ce|mobile);\sppc;/i
|
||||||
|
], [[ARCHITECTURE, 'arm']], [
|
||||||
|
|
||||||
|
/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC
|
||||||
|
], [[ARCHITECTURE, /ower/, '', util.lowerize]], [
|
||||||
|
|
||||||
|
/(sun4\w)[;\)]/i // SPARC
|
||||||
|
], [[ARCHITECTURE, 'sparc']], [
|
||||||
|
|
||||||
|
/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
||||||
|
// IA64, 68K, ARM, IRIX, MIPS, SPARC, PA-RISC
|
||||||
|
], [ARCHITECTURE, util.lowerize]
|
||||||
|
],
|
||||||
|
|
||||||
|
device : [[
|
||||||
|
|
||||||
|
/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook
|
||||||
|
], [MODEL, VENDOR, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
|
||||||
|
], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(apple\s{0,1}tv)/i // Apple TV
|
||||||
|
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
|
||||||
|
|
||||||
|
/(hp).+(touchpad)/i, // HP TouchPad
|
||||||
|
/(kindle)\/([\w\.]+)/i, // Kindle
|
||||||
|
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
|
||||||
|
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
|
||||||
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i, // Kindle Fire HD
|
||||||
|
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone
|
||||||
|
], [MODEL, VENDOR, [TYPE, MOBILE]], [
|
||||||
|
/\((ip[honed|\s\w*]+);/i // iPod/iPhone
|
||||||
|
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
|
||||||
|
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
|
||||||
|
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Huawei/Meizu/Motorola
|
||||||
|
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
|
||||||
|
/(asus)-?(\w+)/i // Asus
|
||||||
|
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
||||||
|
/\((bb10);\s(\w+)/i // BlackBerry 10
|
||||||
|
], [[VENDOR, 'BlackBerry'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
// Asus Tablets
|
||||||
|
/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7))/i
|
||||||
|
], [[VENDOR, 'Asus'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(sony)\s(tablet\s[ps])/i // Sony Tablets
|
||||||
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(nintendo)\s([wids3u]+)/i // Nintendo
|
||||||
|
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
|
||||||
|
|
||||||
|
/((playstation)\s[3portablevi]+)/i // Playstation
|
||||||
|
], [[VENDOR, 'Sony'], MODEL, [TYPE, CONSOLE]], [
|
||||||
|
|
||||||
|
/(sprint\s(\w+))/i // Sprint Phones
|
||||||
|
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
|
||||||
|
/(zte)-(\w+)*/i, // ZTE
|
||||||
|
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
|
||||||
|
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
||||||
|
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
// Motorola
|
||||||
|
/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
|
||||||
|
/(mot)[\s-]?(\w+)*/i
|
||||||
|
], [[VENDOR, 'Motorola'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i
|
||||||
|
], [[VENDOR, 'Motorola'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i
|
||||||
|
], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung
|
||||||
|
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
|
||||||
|
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
|
||||||
|
/sec-((sgh\w+))/i
|
||||||
|
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
/(sie)-(\w+)*/i // Siemens
|
||||||
|
], [[VENDOR, 'Siemens'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
|
||||||
|
/(nokia)[\s_-]?([\w-]+)*/i
|
||||||
|
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/android\s3\.[\s\w-;]{10}((a\d{3}))/i // Acer
|
||||||
|
], [[VENDOR, 'Acer'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
|
||||||
|
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
|
||||||
|
/(lg) netcast\.tv/i // LG SmartTV
|
||||||
|
], [VENDOR, [TYPE, SMARTTV]], [
|
||||||
|
/((nexus\s[45]))/i, // LG
|
||||||
|
/(lg)[e;\s-\/]+(\w+)*/i
|
||||||
|
], [[VENDOR, 'LG'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/android.+((ideatab[a-z0-9\-\s]+))/i // Lenovo
|
||||||
|
], [[VENDOR, 'Lenovo'], MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/(mobile|tablet);.+rv\:.+gecko\//i // Unidentifiable
|
||||||
|
], [TYPE, VENDOR, MODEL]
|
||||||
|
],
|
||||||
|
|
||||||
|
engine : [[
|
||||||
|
/APP-([\w\s-\d]+)\/((\d+)?[\w\.]+)/i // KTA App
|
||||||
|
], [[NAME, 'Mobile-App'], VERSION], [
|
||||||
|
|
||||||
|
/(presto)\/([\w\.]+)/i, // Presto
|
||||||
|
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
|
||||||
|
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
||||||
|
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/rv\:([\w\.]+).*(gecko)/i // Gecko
|
||||||
|
], [VERSION, NAME]
|
||||||
|
],
|
||||||
|
|
||||||
|
os : [[
|
||||||
|
|
||||||
|
// Windows based
|
||||||
|
/microsoft\s(windows)\s(vista|xp)/i, // Windows (iTunes)
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
|
||||||
|
/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
|
||||||
|
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
|
||||||
|
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
|
||||||
|
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
|
||||||
|
|
||||||
|
// Mobile/Embedded OS
|
||||||
|
/\((bb)(10);/i // BlackBerry 10
|
||||||
|
], [[NAME, 'BlackBerry'], VERSION], [
|
||||||
|
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
|
||||||
|
/(tizen)\/([\w\.]+)/i, // Tizen
|
||||||
|
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i
|
||||||
|
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
|
||||||
|
], [[NAME, 'Symbian'], VERSION],[
|
||||||
|
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
|
||||||
|
], [[NAME, 'Firefox OS'], VERSION], [
|
||||||
|
|
||||||
|
// Console
|
||||||
|
/(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation
|
||||||
|
|
||||||
|
// GNU/Linux based
|
||||||
|
/(mint)[\/\s\(]?(\w+)*/i, // Mint
|
||||||
|
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
|
||||||
|
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
||||||
|
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk
|
||||||
|
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
|
||||||
|
/(gnu)\s?([\w\.]+)*/i // GNU
|
||||||
|
], [NAME, VERSION], [
|
||||||
|
|
||||||
|
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
|
||||||
|
], [[NAME, 'Chromium OS'], VERSION],[
|
||||||
|
|
||||||
|
// Solaris
|
||||||
|
/(sunos)\s?([\w\.]+\d)*/i // Solaris
|
||||||
|
], [[NAME, 'Solaris'], VERSION], [
|
||||||
|
|
||||||
|
// BSD based
|
||||||
|
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
|
||||||
|
], [NAME, VERSION],[
|
||||||
|
|
||||||
|
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS
|
||||||
|
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
|
||||||
|
|
||||||
|
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS
|
||||||
|
], [NAME, [VERSION, /_/g, '.']], [
|
||||||
|
|
||||||
|
// Other
|
||||||
|
/(haiku)\s(\w+)/i, // Haiku
|
||||||
|
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
|
||||||
|
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
|
||||||
|
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
|
||||||
|
/(unix)\s?([\w\.]+)*/i // UNIX
|
||||||
|
], [NAME, VERSION]
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////
|
||||||
|
// Constructor
|
||||||
|
////////////////
|
||||||
|
|
||||||
|
|
||||||
|
var UAParser = function (uastring) {
|
||||||
|
|
||||||
|
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
|
||||||
|
|
||||||
|
if (!(this instanceof UAParser)) {
|
||||||
|
return new UAParser(uastring).getResult();
|
||||||
|
}
|
||||||
|
this.getBrowser = function () {
|
||||||
|
return mapper.rgx.apply(this, regexes.browser);
|
||||||
|
};
|
||||||
|
this.getCPU = function () {
|
||||||
|
return mapper.rgx.apply(this, regexes.cpu);
|
||||||
|
};
|
||||||
|
this.getDevice = function () {
|
||||||
|
return mapper.rgx.apply(this, regexes.device);
|
||||||
|
};
|
||||||
|
this.getEngine = function () {
|
||||||
|
return mapper.rgx.apply(this, regexes.engine);
|
||||||
|
};
|
||||||
|
this.getOS = function () {
|
||||||
|
return mapper.rgx.apply(this, regexes.os);
|
||||||
|
};
|
||||||
|
this.getResult = function() {
|
||||||
|
return {
|
||||||
|
ua : this.getUA(),
|
||||||
|
browser : this.getBrowser(),
|
||||||
|
engine : this.getEngine(),
|
||||||
|
os : this.getOS(),
|
||||||
|
device : this.getDevice(),
|
||||||
|
cpu : this.getCPU()
|
||||||
|
};
|
||||||
|
};
|
||||||
|
this.getUA = function () {
|
||||||
|
return ua;
|
||||||
|
};
|
||||||
|
this.setUA = function (uastring) {
|
||||||
|
ua = uastring;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
this.setUA(ua);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///////////
|
||||||
|
// Export
|
||||||
|
//////////
|
||||||
|
|
||||||
|
|
||||||
|
// check js environment
|
||||||
|
if (typeof(exports) !== UNDEF_TYPE) {
|
||||||
|
// nodejs env
|
||||||
|
if (typeof(module) !== UNDEF_TYPE && module.exports) {
|
||||||
|
exports = module.exports = UAParser;
|
||||||
|
}
|
||||||
|
exports.UAParser = UAParser;
|
||||||
|
} else {
|
||||||
|
// browser env
|
||||||
|
window.UAParser = UAParser;
|
||||||
|
// requirejs env (optional)
|
||||||
|
if (typeof(define) === FUNC_TYPE && define.amd) {
|
||||||
|
define(function () {
|
||||||
|
return UAParser;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// jQuery specific (optional)
|
||||||
|
if (typeof(window.jQuery) !== UNDEF_TYPE) {
|
||||||
|
var $ = window.jQuery;
|
||||||
|
var parser = new UAParser();
|
||||||
|
$.ua = parser.getResult();
|
||||||
|
$.ua.get = function() {
|
||||||
|
return parser.getUA();
|
||||||
|
};
|
||||||
|
$.ua.set = function (uastring) {
|
||||||
|
parser.setUA(uastring);
|
||||||
|
var result = parser.getResult();
|
||||||
|
for (var prop in result) {
|
||||||
|
$.ua[prop] = result[prop];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})(this);
|
||||||
1
src/ua-parser.min.js
vendored
Normal file
1
src/ua-parser.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1232
test/browser-test.json
Normal file
1232
test/browser-test.json
Normal file
File diff suppressed because it is too large
Load Diff
122
test/cpu-test.json
Normal file
122
test/cpu-test.json
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"desc" : "i686",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ia32"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "i386",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ia32"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "x86-64",
|
||||||
|
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "win64",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "WOW64",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "ARMv6",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "arm"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Pocket PC",
|
||||||
|
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "arm"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mac PowerPC",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ppc"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mac PowerPC",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ppc"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mac PowerPC",
|
||||||
|
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ppc"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "UltraSPARC",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "sparc"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "QuickTime",
|
||||||
|
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "ia32"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "XBMC",
|
||||||
|
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "amd64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB iPad",
|
||||||
|
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-Nexus 5",
|
||||||
|
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"architecture" : "undefined"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
242
test/device-test.json
Normal file
242
test/device-test.json
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"desc" : "HTC Evo Shift 4G",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "HTC",
|
||||||
|
"model" : "Evo Shift 4G",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LG Nexus 4",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 4.2.1; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "Nexus 4",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LG Nexus 5",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "Nexus 5",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Motorola Droid RAZR 4G",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Motorola",
|
||||||
|
"model" : "DROID RAZR 4G",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iPhone",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPhone",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Motorola Droid RAZR 4G",
|
||||||
|
"ua" : "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPod touch",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "AppleCoreMedia",
|
||||||
|
"ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPad",
|
||||||
|
"type" : "tablet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "AppleTV",
|
||||||
|
"ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "Apple TV",
|
||||||
|
"type" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "AppleTV",
|
||||||
|
"ua" : "AppleCoreMedia/1.0.0.11B511d (Apple TV; U; CPU OS 7_0_3 like Mac OS X; es_es)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "Apple TV",
|
||||||
|
"type" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Dalvik",
|
||||||
|
"ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Samsung",
|
||||||
|
"model" : "GT-S5830L",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "GStreamer",
|
||||||
|
"ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "undefined",
|
||||||
|
"type" : "smarttv"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "HTC Streaming Player",
|
||||||
|
"ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "HTC",
|
||||||
|
"model" : "undefined",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "HTC One S",
|
||||||
|
"ua" : "HTC_One_S/3.16.111.10",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "HTC",
|
||||||
|
"model" : "One S",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LG Player",
|
||||||
|
"ua" : "LG Player 1.0; Android",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "undefined",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "NexPlayer",
|
||||||
|
"ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "P700",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "LG Player",
|
||||||
|
"ua" : "LGE400/V10b Player/LG Player 1.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "E400",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Nokia3xx",
|
||||||
|
"ua" : "Nokia303/14.87 CLDC-1.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Nokia",
|
||||||
|
"model" : "303",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-iPhone",
|
||||||
|
"ua" : "APP-BE/1.0 (iPhone; Apple; CPU iPhone OS 7_0 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPhone",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "stagefright",
|
||||||
|
"ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Samsung",
|
||||||
|
"model" : "GT-I9070",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-iPod Touch",
|
||||||
|
"ua" : "APP-BE/1.0 (iPod touch; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPod touch",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "rad.io",
|
||||||
|
"ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPhone 4S",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Kindle Fire HD",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Amazon",
|
||||||
|
"model" : "KFTT",
|
||||||
|
"type" : "tablet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-iPad",
|
||||||
|
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "Apple",
|
||||||
|
"model" : "iPad",
|
||||||
|
"type" : "tablet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-Nexus 5",
|
||||||
|
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"vendor" : "LG",
|
||||||
|
"model" : "Nexus 5",
|
||||||
|
"type" : "mobile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import { expectType } from 'tsd';
|
|
||||||
import { UAParser, IResult, IBrowser, ICPU, IEngine, IDevice, IOS } from "../src/main/ua-parser";
|
|
||||||
import { isAppleSilicon, isChromiumBased } from "../src/helpers/ua-parser-helpers";
|
|
||||||
|
|
||||||
const uastring = 'Mozilla/5.0 (X11; MyCustomOS; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0';
|
|
||||||
const extensions = {
|
|
||||||
os : [
|
|
||||||
[/(mycustomos)/], [UAParser.OS.NAME, [UAParser.OS.VERSION, '10']]
|
|
||||||
]
|
|
||||||
};
|
|
||||||
const headers = {
|
|
||||||
'sec-ch-ua-mobile' : '?1'
|
|
||||||
};
|
|
||||||
|
|
||||||
expectType<IResult>(UAParser());
|
|
||||||
expectType<IResult>(UAParser(uastring));
|
|
||||||
expectType<IResult>(UAParser(uastring, extensions));
|
|
||||||
expectType<IResult>(UAParser(uastring, headers));
|
|
||||||
expectType<IResult>(UAParser(extensions, headers));
|
|
||||||
expectType<IResult>(UAParser(extensions));
|
|
||||||
expectType<IResult>(UAParser(headers));
|
|
||||||
expectType<UAParser>(new UAParser());
|
|
||||||
|
|
||||||
const parser = new UAParser(uastring);
|
|
||||||
const browser = parser.getBrowser();
|
|
||||||
|
|
||||||
expectType<IBrowser>(browser);
|
|
||||||
expectType<string | undefined>(browser.name);
|
|
||||||
expectType<string | undefined>(browser.version);
|
|
||||||
expectType<string | undefined>(browser.major);
|
|
||||||
expectType<boolean>(browser.is(''));
|
|
||||||
expectType<string>(browser.toString());
|
|
||||||
expectType<IBrowser | PromiseLike<IBrowser>>(browser.withClientHints());
|
|
||||||
expectType<IBrowser>((<IBrowser>browser.withClientHints()).withFeatureCheck());
|
|
||||||
expectType<boolean>((<IBrowser>browser.withClientHints()).withFeatureCheck().is(''));
|
|
||||||
|
|
||||||
expectType<ICPU>(parser.getCPU());
|
|
||||||
expectType<IDevice>(parser.getDevice());
|
|
||||||
expectType<IEngine>(parser.getEngine());
|
|
||||||
expectType<IOS>(parser.getOS());
|
|
||||||
expectType<IResult>(parser.getResult());
|
|
||||||
expectType<string>(parser.getUA());
|
|
||||||
expectType<UAParser>(parser.setUA(uastring));
|
|
||||||
|
|
||||||
const result = parser.getResult();
|
|
||||||
|
|
||||||
expectType<boolean>(isAppleSilicon(result));
|
|
||||||
expectType<boolean>(isChromiumBased(result));
|
|
||||||
84
test/engine-test.json
Normal file
84
test/engine-test.json
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"desc" : "Gecko",
|
||||||
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Gecko",
|
||||||
|
"version" : "2.0b9pre"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KHTML",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "KHTML",
|
||||||
|
"version" : "4.5.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "NetFront",
|
||||||
|
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "NetFront",
|
||||||
|
"version" : "3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Presto",
|
||||||
|
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Presto",
|
||||||
|
"version" : "2.8.149"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Tasman",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Tasman",
|
||||||
|
"version" : "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Trident",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Trident",
|
||||||
|
"version" : "6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "WebKit",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "WebKit",
|
||||||
|
"version" : "533.19.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTA Mobile App",
|
||||||
|
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Mobile-App",
|
||||||
|
"version" : "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-Nexus 5",
|
||||||
|
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Mobile-App",
|
||||||
|
"version" : "1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
const { FuzzedDataProvider } = require('@jazzer.js/core');
|
|
||||||
const UAParser = require('ua-parser-js');
|
|
||||||
const UA_MAX_LENGTH = 350;
|
|
||||||
|
|
||||||
module.exports.fuzz = function (buffer) {
|
|
||||||
const data = new FuzzedDataProvider(buffer);
|
|
||||||
const userAgent = data.consumeString(UA_MAX_LENGTH, 'utf-8', true);
|
|
||||||
const start = process.hrtime();
|
|
||||||
|
|
||||||
UAParser(userAgent);
|
|
||||||
|
|
||||||
const elapsed = process.hrtime(start);
|
|
||||||
const milisec = (elapsed[0]*1e3+elapsed[1]*1e-6).toFixed(3);
|
|
||||||
if (milisec > 1000) {
|
|
||||||
throw new Error(
|
|
||||||
`Potential ReDoS\n` +
|
|
||||||
`Time taken: ${milisec} ms.\n` +
|
|
||||||
`User agent: ${userAgent}`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { UAParser } from '../src/main/ua-parser.mjs';
|
|
||||||
import { CPU, Device, Engine } from '../src/enums/ua-parser-enums.mjs';
|
|
||||||
import * as assert from 'assert';
|
|
||||||
|
|
||||||
describe('Returns', () => {
|
|
||||||
it('getResult() should returns object', () => {
|
|
||||||
assert.deepEqual(new UAParser('').getResult(),
|
|
||||||
{
|
|
||||||
ua : '',
|
|
||||||
//ua_ch : { architecture: undefined, bitness: undefined, brands: undefined, fullVersionList: undefined, mobile: false, model: undefined, platform: undefined, platformVersion: undefined },
|
|
||||||
browser: { name: undefined, version: undefined, major: undefined },
|
|
||||||
cpu: { architecture: undefined },
|
|
||||||
device: { vendor: undefined, model: undefined, type: undefined },
|
|
||||||
engine: { name: undefined, version: undefined},
|
|
||||||
os: { name: undefined, version: undefined }
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Enums', () => {
|
|
||||||
it('Can use enum', () => {
|
|
||||||
const { cpu, device, engine } = UAParser('Mozilla/5.0 (X11; U; Linux armv7l; en-GB; rv:1.9.2a1pre) Gecko/20090928 Firefox/3.5 Maemo Browser 1.4.1.22 RX-51 N900');
|
|
||||||
assert.strictEqual(cpu.is(CPU.ARM), true);
|
|
||||||
assert.strictEqual(device.is(Device.MOBILE), true);
|
|
||||||
assert.strictEqual(engine.is(Engine.GECKO), true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
const assert = require('assert');
|
|
||||||
const parseJS = require('@babel/parser').parse;
|
|
||||||
const traverse = require('@babel/traverse').default;
|
|
||||||
const safe = require('safe-regex');
|
|
||||||
const UAParser = require('../src/main/ua-parser');
|
|
||||||
const { Bots, CLIs, Emails, Modules } = require('../src/extensions/ua-parser-extensions');
|
|
||||||
|
|
||||||
describe('Bots', () => {
|
|
||||||
it('Can detect bots', () => {
|
|
||||||
const googleBot = 'Googlebot-Video/1.0';
|
|
||||||
const gptBot = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)';
|
|
||||||
const msnBot = 'msnbot-media/1.1 (+http://search.msn.com/msnbot.htm)';
|
|
||||||
const bingPreview = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b';
|
|
||||||
const opera = 'Opera/8.5 (Macintosh; PPC Mac OS X; U; en)';
|
|
||||||
const wget = 'Wget/1.21.1';
|
|
||||||
const facebookBot = 'Mozilla/5.0 (compatible; FacebookBot/1.0; +https://developers.facebook.com/docs/sharing/webmasters/facebookbot/)';
|
|
||||||
const outlook = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Microsoft Outlook 16.0.9126; Microsoft Outlook 16.0.9126; ms-office; MSOffice 16)';
|
|
||||||
const thunderbird = 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0';
|
|
||||||
const axios = 'axios/1.3.5';
|
|
||||||
const jsdom = 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/20.0.3';
|
|
||||||
const scrapy = 'Scrapy/1.5.0 (+https://scrapy.org)';
|
|
||||||
|
|
||||||
const botParser = new UAParser(Bots);
|
|
||||||
assert.deepEqual(botParser.setUA(googleBot).getBrowser(), {name: "Googlebot-Video", version: "1.0", major: "1", type: "bot"});
|
|
||||||
assert.deepEqual(botParser.setUA(gptBot).getBrowser(), {name: "GPTBot", version: "1.0", major: "1", type: "bot"});
|
|
||||||
assert.deepEqual(botParser.setUA(msnBot).getBrowser(), {name: "msnbot-media", version: "1.1", major: "1", type: "bot"});
|
|
||||||
assert.deepEqual(botParser.setUA(bingPreview).getBrowser(), {name: "BingPreview", version: "1.0b", major: "1", type: "bot"});
|
|
||||||
assert.deepEqual(botParser.setUA(opera).getBrowser(), {name: "Opera", version: "8.5", major: "8"});
|
|
||||||
|
|
||||||
// try merging Bots & CLIs
|
|
||||||
const botsAndCLIs = { browser : [...Bots.browser, ...CLIs.browser]};
|
|
||||||
const botsAndCLIsParser = new UAParser(botsAndCLIs);
|
|
||||||
assert.deepEqual(botsAndCLIsParser.setUA(wget).getBrowser(), {name: "Wget", version: "1.21.1", major: "1", type:"cli"});
|
|
||||||
assert.deepEqual(botsAndCLIsParser.setUA(facebookBot).getBrowser(), {name: "FacebookBot", version: "1.0", major: "1", type:"bot"});
|
|
||||||
|
|
||||||
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"});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// TODO : move test spec to JSON file
|
|
||||||
|
|
||||||
describe('Testing regexes', () => {
|
|
||||||
|
|
||||||
let regexes;
|
|
||||||
|
|
||||||
before('Read main js file', () => {
|
|
||||||
let code = fs.readFileSync('src/extensions/ua-parser-extensions.js', 'utf8').toString();
|
|
||||||
let ast = parseJS(code, { sourceType: 'script' });
|
|
||||||
regexes = [];
|
|
||||||
traverse(ast, {
|
|
||||||
RegExpLiteral: (path) => {
|
|
||||||
regexes.push(path.node.pattern);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (regexes.length === 0) {
|
|
||||||
throw new Error('Regexes cannot be empty!');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Begin testing', () => {
|
|
||||||
it('all regexes in extension file', () => {
|
|
||||||
regexes.forEach(regex => {
|
|
||||||
describe('Test against `safe-regex` : ' + regex, () => {
|
|
||||||
it('should be safe from potentially vulnerable regex', () => {
|
|
||||||
assert.strictEqual(safe(regex), true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
const assert = require('assert');
|
|
||||||
const UAParser = require('../src/main/ua-parser');
|
|
||||||
const { isAppleSilicon, isChromiumBased } = require('../src/helpers/ua-parser-helpers');
|
|
||||||
|
|
||||||
describe('isAppleSilicon', () => {
|
|
||||||
it('Can detect Apple Silicon device', () => {
|
|
||||||
|
|
||||||
// non-real ua
|
|
||||||
const macARM = 'Mozilla/5.0 (Macintosh; ARM; Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0';
|
|
||||||
const macIntel = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0';
|
|
||||||
|
|
||||||
assert.equal(isAppleSilicon(UAParser(macIntel)), false);
|
|
||||||
assert.equal(isAppleSilicon(UAParser(macARM)), true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isChromiumBased', () => {
|
|
||||||
it('Can detect Chromium-based browser', () => {
|
|
||||||
|
|
||||||
const edge = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.2151.58';
|
|
||||||
const firefox = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0';
|
|
||||||
|
|
||||||
assert.equal(isChromiumBased(UAParser(edge)), true);
|
|
||||||
assert.equal(isChromiumBased(UAParser(firefox)), false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
File diff suppressed because one or more lines are too long
596
test/os-test.json
Normal file
596
test/os-test.json
Normal file
@@ -0,0 +1,596 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"desc" : "Windows 95",
|
||||||
|
"ua" : "Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "95"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows 98",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "98"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows ME",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90) Gecko/20020502 CS 2000 7.0/7.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "ME"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows 2000",
|
||||||
|
"ua" : "Mozilla/3.0 (compatible; MSIE 3.0; Windows NT 5.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "2000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows XP",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 5.2)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "XP"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows Vista",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; fr-FR)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "Vista"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows 7",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows 8",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows RT",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "RT"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows CE",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "CE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows Mobile",
|
||||||
|
"ua" : "Mozilla/5.0 (ZTE-E_N72/N72V1.0.0B02;U;Windows Mobile/6.1;Profile/MIDP-2.0 Configuration/CLDC-1.1;320*240;CTC/2.0) IE/6.0 (compatible; MSIE 4.01; Windows CE; PPC)/UC Browser7.7.1.88",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows Mobile",
|
||||||
|
"version" : "6.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows Phone OS",
|
||||||
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows Phone OS",
|
||||||
|
"version" : "7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Windows Phone 8",
|
||||||
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; Windows Phone 8X by HTC)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows Phone",
|
||||||
|
"version" : "8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "BlackBerry",
|
||||||
|
"ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "BlackBerry",
|
||||||
|
"version" : "5.0.0.912"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "BlackBerry 10",
|
||||||
|
"ua" : "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "BlackBerry",
|
||||||
|
"version" : "10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Tizen",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Android",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Android",
|
||||||
|
"version" : "2.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "WebOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Palm OS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "QNX",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Bada",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "RIM Tablet OS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "MeeGo",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Symbian",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Firefox OS",
|
||||||
|
"ua" : "Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Firefox OS",
|
||||||
|
"version" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Nintendo",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "PlayStation",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mint",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Joli",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Ubuntu",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Debian",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "OpenSUSE",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Gentoo",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Arch",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Slackware",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Fedora",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mandriva",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "CentOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "PCLinuxOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "RedHat",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Zenwalk",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Hurd",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Linux",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "GNU",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Chromium OS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Solaris",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "FreeBSD",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "OpenBSD",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "NetBSD",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "DragonFly",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iOS with Chrome",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "iOS",
|
||||||
|
"version" : "5.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iOS with Opera Mini",
|
||||||
|
"ua" : "Opera/9.80 (iPhone; Opera Mini/7.1.32694/27.1407; U; en) Presto/2.8.119 Version/11.10",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "iOS",
|
||||||
|
"version" : "undefined"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Mac OS",
|
||||||
|
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Mac OS X",
|
||||||
|
"version" : "10.6.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Haiku",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "AIX",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Plan9",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "Minix",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "BeOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "OS/2",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "AmigaOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "MorphOS",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "UNIX",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iTunes Windows Vista",
|
||||||
|
"ua" : "iTunes/10.7 (Windows; Microsoft Windows Vista Home Premium Edition Service Pack 1 (Build 6001)) AppleWebKit/536.26.9",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Windows",
|
||||||
|
"version" : "Vista"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "",
|
||||||
|
"ua" : "",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "",
|
||||||
|
"version" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "iOS BE App",
|
||||||
|
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "iOS",
|
||||||
|
"version" : "7.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "KTB-Nexus 5",
|
||||||
|
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "Android",
|
||||||
|
"version" : "4.2.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
|
||||||
import path from 'path';
|
|
||||||
import url from 'url';
|
|
||||||
|
|
||||||
const localHtml = `file://${path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), '../')}/dist/ua-parser.html`;
|
|
||||||
|
|
||||||
test.describe('test input', () => {
|
|
||||||
test.beforeEach(async ({ page }) => {
|
|
||||||
await page.goto(localHtml);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('accept empty string', async ({ page }) => {
|
|
||||||
// @ts-ignore
|
|
||||||
const uap = await page.evaluate(async () => await UAParser(''));
|
|
||||||
expect(uap).toHaveProperty('ua', '');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('read client hints data', async ({ page }) => {
|
|
||||||
await page.addInitScript(() => {
|
|
||||||
Object.defineProperty(navigator, 'userAgentData', {
|
|
||||||
value: {
|
|
||||||
brands: [],
|
|
||||||
platform: '',
|
|
||||||
mobile: false,
|
|
||||||
getHighEntropyValues: () => {
|
|
||||||
return Promise.resolve({
|
|
||||||
brands: [
|
|
||||||
{
|
|
||||||
brand: 'Chromium',
|
|
||||||
version: '110'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'Not(A:Brand',
|
|
||||||
version: '110'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'New Browser',
|
|
||||||
version: '110'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
platform: 'New OS',
|
|
||||||
formFactor: 'New Form Factor'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
await page.goto(localHtml);
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
const uap = await page.evaluate(async () => await UAParser().withClientHints());
|
|
||||||
|
|
||||||
expect(uap).toHaveProperty('browser.name', 'New Browser');
|
|
||||||
expect(uap).toHaveProperty('os.name', 'New OS');
|
|
||||||
expect(uap).toHaveProperty('device.type', undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('detect Brave', async ({ page }) => {
|
|
||||||
await page.addInitScript(() => {
|
|
||||||
Object.defineProperty(navigator, 'brave', {
|
|
||||||
value: {
|
|
||||||
isBrave: () => true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
await page.goto(localHtml);
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
let uap = await page.evaluate(() => UAParser());
|
|
||||||
expect(uap).toHaveProperty('browser.name', 'Chrome Headless');
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
uap = await page.evaluate(() => UAParser().withFeatureCheck());
|
|
||||||
expect(uap).toHaveProperty('browser.name', 'Brave');
|
|
||||||
});
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,266 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"desc" : "i686",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ia32"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "i386",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ia32"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "x86-64",
|
|
||||||
"ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Windows",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Windows",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Linux",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Linux",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ia32"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Xiaomi POCO M2 Pro",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; arm_64; Android 11; POCO M2 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 YaBrowser/22.11.7.42.00 SA/3 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "win64",
|
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WOW64",
|
|
||||||
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARM",
|
|
||||||
"ua" : "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 635) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMv61",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMv7",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux ARMv7) WebKitGTK+/3.4.9 vimprobable2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMv7l",
|
|
||||||
"ua" : "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMv7l",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; CrOS armv7l 9765.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.123 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Nokia N900 Linux mobile",
|
|
||||||
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMEABI",
|
|
||||||
"ua" : "[FBAN/FB4A;FBAV/237.0.0.44.120;FBBV/170693408;FBDM/{density=1.75,width=720,height=1280};FBLC/en_US;FBRV/172067074;FBCR/ ;FBMF/samsung;FBBD/samsung;FBPN/com.facebook.katana;FBDV/SM-S367VL;FBSV/9;FBBK/1;FBOP/19;FBCA/armeabi-v7a:armeabi;]",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARMv8",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux armv8l; rv:45.0) Gecko/20100101 Firefox/45.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "AARCH64",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; CrOS aarch64 13310.93.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.133 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARM64",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; ARM64; RM-1096) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "ARM64",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 9; HRY-LX1T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 YaBrowser/19.12.1.121.00 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Google Search App",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 6.0; M5s Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.147 Mobile Safari/537.36 GSA/12.40.17.23.arm64",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Pocket PC",
|
|
||||||
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Mac PowerPC",
|
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ppc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Mac PowerPC",
|
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ppc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Mac PowerPC",
|
|
||||||
"ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ppc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Mac OS X on PowerPC using Firefox",
|
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ppc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "UltraSPARC",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "sparc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "sparc64",
|
|
||||||
"ua" : "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "sparc64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "QuickTime",
|
|
||||||
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ia32"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "XBMC",
|
|
||||||
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "IRIX64",
|
|
||||||
"ua" : "Mozilla/4.8C-SGI [en] (X11; U; IRIX64 6.5 IP27",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "irix64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "68k",
|
|
||||||
"ua" : "'Mozilla/1.1 (Macintosh; U; 68K)'",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "68k"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,164 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"desc" : "Blink",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Blink",
|
|
||||||
"version" : "57.0.2987.146"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "EdgeHTML",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "EdgeHTML",
|
|
||||||
"version" : "12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Flow",
|
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Flow",
|
|
||||||
"version" : "5.7.4.30559"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Gecko",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Gecko",
|
|
||||||
"version" : "2.0b9pre"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Goanna",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 5.1; rv:38.9) Gecko/20100101 Goanna/2.2 Firefox/38.9 PaleMoon/26.5.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Goanna",
|
|
||||||
"version" : "2.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "KHTML",
|
|
||||||
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "KHTML",
|
|
||||||
"version" : "4.5.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "LibWeb",
|
|
||||||
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "LibWeb",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NetFront",
|
|
||||||
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NetFront",
|
|
||||||
"version" : "3.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Presto",
|
|
||||||
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Presto",
|
|
||||||
"version" : "2.8.149"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Tasman",
|
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Tasman",
|
|
||||||
"version" : "1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Trident",
|
|
||||||
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Trident",
|
|
||||||
"version" : "6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebKit",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "WebKit",
|
|
||||||
"version" : "533.19.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebKit",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/27.0.1453.110 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "WebKit",
|
|
||||||
"version" : "537.36"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebOS TV 5.x",
|
|
||||||
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Blink",
|
|
||||||
"version" : "68.0.3440.106"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebOS TV 4.x",
|
|
||||||
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Blink",
|
|
||||||
"version" : "53.0.2785.34"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebOS TV 3.x",
|
|
||||||
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Blink",
|
|
||||||
"version" : "38.0.2125.122"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebOS TV 2.x",
|
|
||||||
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "WebKit",
|
|
||||||
"version" : "538.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WebOS TV 1.x",
|
|
||||||
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "WebKit",
|
|
||||||
"version" : "537.41"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,342 +0,0 @@
|
|||||||
[{
|
|
||||||
"desc": "Essential PH-1",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 9; PH-1 Build/PPR1.180905.036) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Essential",
|
|
||||||
"model": "PH-1",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Gigaset Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Gigaset QV830 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Gigaset",
|
|
||||||
"model": "QV830",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "RCA Voyager III Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; RCT6973W43 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "RCA",
|
|
||||||
"model": "RCT6973W43",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "RCA Voyager II Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.0; RCT6773W22B Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "RCA",
|
|
||||||
"model": "RCT6773W22B",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Verizon Quanta Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; QMV7B Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Verizon",
|
|
||||||
"model": "QMV7B",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Verizon Ellipsis 8 Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.1.1; QTAQZ3 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Verizon",
|
|
||||||
"model": "QTAQZ3",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Verizon Ellipsis 8HD Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; QTASUN1 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Verizon",
|
|
||||||
"model": "QTASUN1",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Dell Venue 8 Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 8 3830 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Dell",
|
|
||||||
"model": "Venue 8 3830",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Dell Venue 7 Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 7 3730 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Dell",
|
|
||||||
"model": "Venue 7 3730",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Barnes & Noble Nook HD+ Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; Barnes & Noble Nook HD+ Build/JZO54K; CyanogenMod-10) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Barnes & Noble",
|
|
||||||
"model": "Nook HD+",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Barnes & Noble V400 Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Barnes & Noble",
|
|
||||||
"model": "V400",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "NuVision TM101A540N Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.1; TM101A540N Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "NuVision",
|
|
||||||
"model": "TM101A540N",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE-Z431",
|
|
||||||
"ua": "ZTE-Z431/1.4.0 NetFront/4.2 QTV5.1 Profile/MIDP-2.1 Configuration/CLDC-1.1",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "Z431",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; ZTE-Z740G Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "Z740G",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE K Series Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 6.0.1; K88 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "K88",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE Nubia Red Magic 3",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 9; NX629J Build/PKQ1.190321.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/45016 Mobile Safari/537.36 MMWEBID/4064 MicroMessenger/7.0.10.1580(0x27000A34) Process/tools NetType/WIFI Language/zh_CN ABI/arm64",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "NX629J",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE Blade A5",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 9; ZTE Blade A5 2019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "Blade A5 2019",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE BLADE V0730",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 6.0; ZTE BLADE V0730) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "BLADE V0730",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "ZTE B2017G",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 7.1.1; ZTE B2017G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "ZTE",
|
|
||||||
"model": "B2017G",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Swizz GEN610",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; GEN610 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Swiss",
|
|
||||||
"model": "GEN610",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Swizz ZUR700",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; ZUR700 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Swiss",
|
|
||||||
"model": "ZUR700",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Zeki TB782b Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-US; TB782B Build/IMM76D) AppleWebKit/534.31 (KHTML, like Gecko) UCBrowser/9.0.2.299 U3/0.8.0 Mobile Safari/534.31",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Zeki",
|
|
||||||
"model": "TB782B",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Dragon Touch Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.0.4; DT9138B Build/IMM76D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Dragon Touch",
|
|
||||||
"model": "9138B",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Insignia Tablet",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; NS-P08A7100 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Insignia",
|
|
||||||
"model": "NS-P08A7100",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Voice Xtreme V75",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; V75 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Voice",
|
|
||||||
"model": "V75",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "LvTel V11",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.1.1; V11 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "LvTel",
|
|
||||||
"model": "V11",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Envizen Tablet V100MD",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; V100MD Build/V100MD.20130816) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Envizen",
|
|
||||||
"model": "V100MD",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Rotor Tablet",
|
|
||||||
"ua": "mozilla/5.0 (linux; android 5.0.1; tu_1491 build/lrx22c) applewebkit/537.36 (khtml, like gecko) chrome/43.0.2357.93 safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Rotor",
|
|
||||||
"model": "1491",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "MachSpeed Tablets",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; Trio 7.85 vQ Build/Trio_7.85_vQ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "MachSpeed",
|
|
||||||
"model": "Trio 7.85 vQ",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Trinity Tablets",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.0.1; Trinity T101 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Trinity",
|
|
||||||
"model": "T101",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "NextBook Next7",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Next7P12 Build/IMM76I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "NextBook",
|
|
||||||
"model": "Next7P12",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "NextBook Tablets",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.0; NXA8QC116 Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "NextBook",
|
|
||||||
"model": "NXA8QC116",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Le Pan Tablets",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Le Pan",
|
|
||||||
"model": "TC802A",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Le Pan Tablets",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Le Pan",
|
|
||||||
"model": "TC802A",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "AT&T Radiant Core U304AA",
|
|
||||||
"ua": "Dalvik/2.1.0 (Linux; U; Android 9; U304AA Build/P00610)",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "AT&T",
|
|
||||||
"model": "U304AA",
|
|
||||||
"type": "mobile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Vodafone Smart Tab 4G",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.4; Vodafone Smart Tab 4G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Vodafone",
|
|
||||||
"model": "Smart Tab 4G",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Vodafone Smart ultra 6",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 5.0.2; Vodafone Smart ultra 6 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "Vodafone",
|
|
||||||
"model": "Smart ultra 6",
|
|
||||||
"type": "tablet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "4ife 4K Smart TV Box",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; 4ife 4K Smart TV Box Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36 Vinebre",
|
|
||||||
"expect": {
|
|
||||||
"vendor": "undefined",
|
|
||||||
"model": "undefined",
|
|
||||||
"type": "smarttv"
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
@@ -1,582 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"desc" : "Coremedia",
|
|
||||||
"ua" : "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "CoreMedia",
|
|
||||||
"version" : "1.0.0.10F2108",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "AppleCoreMedia",
|
|
||||||
"ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "AppleCoreMedia",
|
|
||||||
"version" : "1.0.0.10A403",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "AppleTv",
|
|
||||||
"ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "WebKit",
|
|
||||||
"version" : "528.18",
|
|
||||||
"major" : "528"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Aqualung",
|
|
||||||
"ua" : "Aqualung/R-1114",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Aqualung",
|
|
||||||
"version" : "R-1114",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Ares",
|
|
||||||
"ua" : "Ares 2.2.4.3048",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Ares",
|
|
||||||
"version" : "2.2.4.3048",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Audacious",
|
|
||||||
"ua" : "Audacious/3.2.2 neon/0.29.3",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Audacious",
|
|
||||||
"version" : "3.2.2",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "AudiMusicStream",
|
|
||||||
"ua" : "AudiMusicStream/3020.130826151911",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "AudiMusicStream",
|
|
||||||
"version" : "3020.130826151911",
|
|
||||||
"major" : "3020"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "BASS",
|
|
||||||
"ua" : "BASS/2.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "BASS",
|
|
||||||
"version" : "2.4",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "BSPlayer",
|
|
||||||
"ua" : "BSPlayer/2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "BSPlayer",
|
|
||||||
"version" : "2",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Core",
|
|
||||||
"ua" : "CORE/6.506.4.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "CORE",
|
|
||||||
"version" : "6.506.4.1",
|
|
||||||
"major" : "6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Clementine",
|
|
||||||
"ua" : "Clementine 1.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Clementine",
|
|
||||||
"version" : "1.1",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Dalvik",
|
|
||||||
"ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Dalvik",
|
|
||||||
"version" : "1.2.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NexPlayer",
|
|
||||||
"ua" : "E97510d/ Player/NexPlayer 4.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NexPlayer",
|
|
||||||
"version" : "4.0",
|
|
||||||
"major" : "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "FLRP",
|
|
||||||
"ua" : "FLRP/2.5 CFNetwork/609.1.4 Darwin/13.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Flip Player",
|
|
||||||
"version" : "2.5",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "FStream",
|
|
||||||
"ua" : "FStream",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "FStream",
|
|
||||||
"version" : "undefined",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "GStreamer",
|
|
||||||
"ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "GStreamer",
|
|
||||||
"version" : "2.34.2",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "GnomeMplayer",
|
|
||||||
"ua" : "GnomeMplayer/1.0.2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "GnomeMplayer",
|
|
||||||
"version" : "1.0.2",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "HTC Streaming Player",
|
|
||||||
"ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "HTC Streaming Player",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "HTC One S",
|
|
||||||
"ua" : "HTC_One_S/3.16.111.10",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "HTC One S",
|
|
||||||
"version" : "3.16.111.10",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Java",
|
|
||||||
"ua" : "Java/1.4.1_04",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Java",
|
|
||||||
"version" : "1.4.1_04",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "LG Player",
|
|
||||||
"ua" : "LG Player 1.0; Android",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "LG Player",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NexPlayer",
|
|
||||||
"ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NexPlayer",
|
|
||||||
"version" : "4.0",
|
|
||||||
"major" : "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "LG Player",
|
|
||||||
"ua" : "LGE400/V10b Player/LG Player 1.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "LG Player",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Lavf",
|
|
||||||
"ua" : "Lavf52.111.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Lavf",
|
|
||||||
"version" : "52.111.0",
|
|
||||||
"major" : "52"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Lyssna",
|
|
||||||
"ua" : "Lyssna/46 CFNetwork/609.1.4 Darwin/13.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Lyssna",
|
|
||||||
"version" : "46",
|
|
||||||
"major" : "46"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MPlayer",
|
|
||||||
"ua" : "MPlayer 1.1-4.2.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "MPlayer",
|
|
||||||
"version" : "1.1-4.2.1",
|
|
||||||
"major" : ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MPlayer SVN",
|
|
||||||
"ua" : "MPlayer SVN-r33713-4.6.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "MPlayer",
|
|
||||||
"version" : "r33713-4.6.1",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MPlayer ubuntu",
|
|
||||||
"ua" : "MPlayer svn r34540 (Ubuntu), built with gcc-4.6",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "MPlayer",
|
|
||||||
"version" : "r34540",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MoC",
|
|
||||||
"ua" : "Music On Console/2.5.0-beta1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Music On Console",
|
|
||||||
"version" : "2.5.0-beta1",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MPD",
|
|
||||||
"ua" : "Music Player Daemon 0.17.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Music Player Daemon",
|
|
||||||
"version" : "0.17.4",
|
|
||||||
"major" : "0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NSPlayer",
|
|
||||||
"ua" : "NSPlayer/11.0.5358.4827 WMFSDK/11.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NSPlayer",
|
|
||||||
"version" : "11.0.5358.4827",
|
|
||||||
"major" : "11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Nero Home",
|
|
||||||
"ua" : "Nero Home/1.5.3.0 (compatible; Nero AG; Nero Home 1.5.3.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Nero Home",
|
|
||||||
"version" : "1.5.3.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NexPlayer",
|
|
||||||
"ua" : "NexPlayer 4.0 for Android( stagefright alternative )",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NexPlayer",
|
|
||||||
"version" : "4.0",
|
|
||||||
"major" : "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Nokia3xx",
|
|
||||||
"ua" : "Nokia303/14.87 CLDC-1.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Nokia303",
|
|
||||||
"version" : "14.87",
|
|
||||||
"major" : "14"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "MPlayer SVN Sherpya",
|
|
||||||
"ua" : "MPlayer Sherpya-SVN-r33124-4.2.5",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "MPlayer",
|
|
||||||
"version" : "r33124-4.2.5",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Philips Songbird",
|
|
||||||
"ua" : "NotMoz/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) Gecko/20101207 Philips-Songbird/5.4.1980 Songbird/1.9.4 (20110302030555)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Songbird",
|
|
||||||
"version" : "1.9.4",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Ossproxy",
|
|
||||||
"ua" : "OSSProxy 1.3.336.320 (Build 336.320 Win32 en-us)(Aug 16 2013 17:38:43)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "OSSProxy",
|
|
||||||
"version" : "1.3.336.320",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Winamp3",
|
|
||||||
"ua" : "Nullsoft Winamp3 version 3.0 (compatible)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Winamp",
|
|
||||||
"version" : "3.0",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "PSP",
|
|
||||||
"ua" : "PSP-InternetRadioPlayer/1.00",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "PSP-InternetRadioPlayer",
|
|
||||||
"version" : "1.00",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "urllib",
|
|
||||||
"ua" : "Python-urllib/2.7",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Python-urllib",
|
|
||||||
"version" : "2.7",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "QuickTime",
|
|
||||||
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "QuickTime",
|
|
||||||
"version" : "7.5.6",
|
|
||||||
"major" : "7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "RMA",
|
|
||||||
"ua" : "RMA/1.0 (compatible; RealMedia)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "RMA",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "RadioApp",
|
|
||||||
"ua" : "RadioApp/1.0 CFNetwork/609.1.4 Darwin/11.4.2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "RadioApp",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "RadioClientApplication",
|
|
||||||
"ua" : "RadioClientApplication/20 CFNetwork/609.1.4 Darwin/13.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "RadioClientApplication",
|
|
||||||
"version" : "20",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "stagefright",
|
|
||||||
"ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "stagefright",
|
|
||||||
"version" : "1.1",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Soundtap",
|
|
||||||
"ua" : "Soundtap/1.2.4 CFNetwork/672.0.2 Darwin/14.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Soundtap",
|
|
||||||
"version" : "1.2.4",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Streamium",
|
|
||||||
"ua" : "Streamium/1.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Streamium",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Totem",
|
|
||||||
"ua" : "Totem/3.0.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Totem",
|
|
||||||
"version" : "3.0.1",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "VLC",
|
|
||||||
"ua" : "VLC media player - version 0.8.6c Janus - (c) 1996-2007 the VideoLAN team",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "VLC",
|
|
||||||
"version" : "0.8.6c",
|
|
||||||
"major" : "0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "VLC",
|
|
||||||
"ua" : "VLC/2.0.0 LibVLC/2.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "VLC",
|
|
||||||
"version" : "2.0.0",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Videos",
|
|
||||||
"ua" : "Videos/3.8.2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Video",
|
|
||||||
"version" : "3.8.2",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Wget",
|
|
||||||
"ua" : "Wget/1.12 (darwin10.7.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Wget",
|
|
||||||
"version" : "1.12",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Winamp",
|
|
||||||
"ua" : "Winamp 2.81",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Winamp",
|
|
||||||
"version" : "2.81",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Winamp",
|
|
||||||
"ua" : "WinampMPEG/2.00",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Winamp",
|
|
||||||
"version" : "2.00",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Windows Media Player",
|
|
||||||
"ua" : "Windows-Media-Player/10.00.00.4019",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Windows Media Player",
|
|
||||||
"version" : "10.00.00.4019",
|
|
||||||
"major" : "10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "XBMC",
|
|
||||||
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "XBMC",
|
|
||||||
"version" : "12.0",
|
|
||||||
"major" : "12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "rad.io",
|
|
||||||
"ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "rad.io",
|
|
||||||
"version" : "1.18.1",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "BE-Test",
|
|
||||||
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "BE Test",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
File diff suppressed because it is too large
Load Diff
65
test/test.js
Normal file
65
test/test.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
var assert = require('assert');
|
||||||
|
var UAParser = require('./../src/ua-parser');
|
||||||
|
var browsers = require('./browser-test.json');
|
||||||
|
var cpus = require('./cpu-test.json');
|
||||||
|
var devices = require('./device-test.json');
|
||||||
|
var engines = require('./engine-test.json');
|
||||||
|
var os = require('./os-test.json');
|
||||||
|
var parser = new UAParser();
|
||||||
|
var methods = [
|
||||||
|
{
|
||||||
|
title : 'getBrowser',
|
||||||
|
label : 'browser',
|
||||||
|
list : browsers,
|
||||||
|
properties : ['name', 'major', 'version']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title : 'getCPU',
|
||||||
|
label : 'cpu',
|
||||||
|
list : cpus,
|
||||||
|
properties : ['architecture']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title : 'getDevice',
|
||||||
|
label : 'device',
|
||||||
|
list : devices,
|
||||||
|
properties : ['model', 'type', 'vendor']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title : 'getEngine',
|
||||||
|
label : 'engine',
|
||||||
|
list : engines,
|
||||||
|
properties : ['name', 'version']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title : 'getOS',
|
||||||
|
label : 'os',
|
||||||
|
list : os,
|
||||||
|
properties : ['name', 'version']
|
||||||
|
}];
|
||||||
|
|
||||||
|
describe('UAParser()', function () {
|
||||||
|
var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6';
|
||||||
|
assert.deepEqual(UAParser(ua), new UAParser().setUA(ua).getResult());
|
||||||
|
});
|
||||||
|
|
||||||
|
for (var i in methods) {
|
||||||
|
describe(methods[i]['title'], function () {
|
||||||
|
for (var j in methods[i]['list']) {
|
||||||
|
if (!!methods[i]['list'][j].ua) {
|
||||||
|
describe('[' + methods[i]['list'][j].desc + ']', function () {
|
||||||
|
describe('"' + methods[i]['list'][j].ua + '"', function () {
|
||||||
|
var expect = methods[i]['list'][j].expect;
|
||||||
|
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
|
||||||
|
|
||||||
|
methods[i]['properties'].forEach(function(m) {
|
||||||
|
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
|
||||||
|
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
32
ua-parser-js.jquery.json
Normal file
32
ua-parser-js.jquery.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"title": "UAParser.js",
|
||||||
|
"name": "ua-parser-js",
|
||||||
|
"version": "0.7.0",
|
||||||
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
|
"keywords": [
|
||||||
|
"user-agent",
|
||||||
|
"parser",
|
||||||
|
"browser",
|
||||||
|
"engine",
|
||||||
|
"os",
|
||||||
|
"device",
|
||||||
|
"cpu"
|
||||||
|
],
|
||||||
|
"homepage": "https://faisalman.github.com/ua-parser-js",
|
||||||
|
"author": {
|
||||||
|
"name": "Faisal Salman",
|
||||||
|
"email": "fyzlman@gmail.com"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"jquery": ">=1.5"
|
||||||
|
},
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "http://www.opensource.org/licenses/mit-license.php"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
||||||
|
"docs": "https://github.com/faisalman/ua-parser-js",
|
||||||
|
"download": "https://raw.github.com/faisalman/ua-parser-js/master/src/ua-parser.min.js"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user