mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-16 15:11:50 +03:00
Compare commits
3 Commits
2.0.0-beta
...
1.0.33
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67005e3494 | ||
|
|
a2b2e805fa | ||
|
|
1bf1c732c7 |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: faisalman
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
patreon: # Replace with a single Patreon username
|
patreon: # Replace with a single Patreon username
|
||||||
open_collective: ua-parser-js
|
open_collective: ua-parser-js
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
|||||||
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 }}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: UAParser.js CI-Test
|
name: ua-parser-js-run-test
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
@@ -12,12 +12,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
arch: [amd64, ppc64le]
|
arch: [amd64, ppc64le]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v2
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
- name: Run the test
|
- name: Run the test
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm install
|
||||||
npx playwright install
|
npm run test-ci
|
||||||
npm test
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
playwright-report/
|
|
||||||
test-results/
|
|
||||||
|
|
||||||
### vim ###
|
### vim ###
|
||||||
.*.s[a-w][a-z]
|
.*.s[a-w][a-z]
|
||||||
|
|||||||
18
.travis.yml
Normal file
18
.travis.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
arch:
|
||||||
|
- amd64
|
||||||
|
- ppc64le
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- stable
|
||||||
|
- lts/*
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
script: npm run test-ci
|
||||||
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
|
|
||||||
616
LICENSE.md
616
LICENSE.md
@@ -1,616 +0,0 @@
|
|||||||
# GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
|
||||||
<https://fsf.org/>
|
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this
|
|
||||||
license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
## Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains
|
|
||||||
free software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing
|
|
||||||
under this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
## TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
### 0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds
|
|
||||||
of works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of
|
|
||||||
an exact copy. The resulting work is called a "modified version" of
|
|
||||||
the earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user
|
|
||||||
through a computer network, with no transfer of a copy, is not
|
|
||||||
conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices" to
|
|
||||||
the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
### 1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. "Object code" means any non-source form of
|
|
||||||
a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users can
|
|
||||||
regenerate automatically from other parts of the Corresponding Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that same
|
|
||||||
work.
|
|
||||||
|
|
||||||
### 2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not convey,
|
|
||||||
without conditions so long as your license otherwise remains in force.
|
|
||||||
You may convey covered works to others for the sole purpose of having
|
|
||||||
them make modifications exclusively for you, or provide you with
|
|
||||||
facilities for running those works, provided that you comply with the
|
|
||||||
terms of this License in conveying all material for which you do not
|
|
||||||
control copyright. Those thus making or running the covered works for
|
|
||||||
you must do so exclusively on your behalf, under your direction and
|
|
||||||
control, on terms that prohibit them from making any copies of your
|
|
||||||
copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under the
|
|
||||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
|
||||||
it unnecessary.
|
|
||||||
|
|
||||||
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such
|
|
||||||
circumvention is effected by exercising rights under this License with
|
|
||||||
respect to the covered work, and you disclaim any intention to limit
|
|
||||||
operation or modification of the work as a means of enforcing, against
|
|
||||||
the work's users, your or third parties' legal rights to forbid
|
|
||||||
circumvention of technological measures.
|
|
||||||
|
|
||||||
### 4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
### 5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
- a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
- b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under
|
|
||||||
section 7. This requirement modifies the requirement in section 4
|
|
||||||
to "keep intact all notices".
|
|
||||||
- c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
- d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
### 6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms of
|
|
||||||
sections 4 and 5, provided that you also convey the machine-readable
|
|
||||||
Corresponding Source under the terms of this License, in one of these
|
|
||||||
ways:
|
|
||||||
|
|
||||||
- a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
- b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the Corresponding
|
|
||||||
Source from a network server at no charge.
|
|
||||||
- c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
- d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
- e) Convey the object code using peer-to-peer transmission,
|
|
||||||
provided you inform other peers where the object code and
|
|
||||||
Corresponding Source of the work are being offered to the general
|
|
||||||
public at no charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal,
|
|
||||||
family, or household purposes, or (2) anything designed or sold for
|
|
||||||
incorporation into a dwelling. In determining whether a product is a
|
|
||||||
consumer product, doubtful cases shall be resolved in favor of
|
|
||||||
coverage. For a particular product received by a particular user,
|
|
||||||
"normally used" refers to a typical or common use of that class of
|
|
||||||
product, regardless of the status of the particular user or of the way
|
|
||||||
in which the particular user actually uses, or expects or is expected
|
|
||||||
to use, the product. A product is a consumer product regardless of
|
|
||||||
whether the product has substantial commercial, industrial or
|
|
||||||
non-consumer uses, unless such uses represent the only significant
|
|
||||||
mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to
|
|
||||||
install and execute modified versions of a covered work in that User
|
|
||||||
Product from a modified version of its Corresponding Source. The
|
|
||||||
information must suffice to ensure that the continued functioning of
|
|
||||||
the modified object code is in no case prevented or interfered with
|
|
||||||
solely because modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or
|
|
||||||
updates for a work that has been modified or installed by the
|
|
||||||
recipient, or for the User Product in which it has been modified or
|
|
||||||
installed. Access to a network may be denied when the modification
|
|
||||||
itself materially and adversely affects the operation of the network
|
|
||||||
or violates the rules and protocols for communication across the
|
|
||||||
network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
### 7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders
|
|
||||||
of that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
- a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
- b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
- c) Prohibiting misrepresentation of the origin of that material,
|
|
||||||
or requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
- d) Limiting the use for publicity purposes of names of licensors
|
|
||||||
or authors of the material; or
|
|
||||||
- e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
- f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions
|
|
||||||
of it) with contractual assumptions of liability to the recipient,
|
|
||||||
for any liability that these contractual assumptions directly
|
|
||||||
impose on those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions; the
|
|
||||||
above requirements apply either way.
|
|
||||||
|
|
||||||
### 8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your license
|
|
||||||
from a particular copyright holder is reinstated (a) provisionally,
|
|
||||||
unless and until the copyright holder explicitly and finally
|
|
||||||
terminates your license, and (b) permanently, if the copyright holder
|
|
||||||
fails to notify you of the violation by some reasonable means prior to
|
|
||||||
60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
### 9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or run
|
|
||||||
a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
### 10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
### 11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims owned
|
|
||||||
or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within the
|
|
||||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
|
||||||
the non-exercise of one or more of the rights that are specifically
|
|
||||||
granted under this License. You may not convey a covered work if you
|
|
||||||
are a party to an arrangement with a third party that is in the
|
|
||||||
business of distributing software, under which you make payment to the
|
|
||||||
third party based on the extent of your activity of conveying the
|
|
||||||
work, and under which the third party grants, to any of the parties
|
|
||||||
who would receive the covered work from you, a discriminatory patent
|
|
||||||
license (a) in connection with copies of the covered work conveyed by
|
|
||||||
you (or copies made from those copies), or (b) primarily for and in
|
|
||||||
connection with specific products or compilations that contain the
|
|
||||||
covered work, unless you entered into that arrangement, or that patent
|
|
||||||
license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
### 12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under
|
|
||||||
this License and any other pertinent obligations, then as a
|
|
||||||
consequence you may not convey it at all. For example, if you agree to
|
|
||||||
terms that obligate you to collect a royalty for further conveying
|
|
||||||
from those to whom you convey the Program, the only way you could
|
|
||||||
satisfy both those terms and this License would be to refrain entirely
|
|
||||||
from conveying the Program.
|
|
||||||
|
|
||||||
### 13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your
|
|
||||||
version supports such interaction) an opportunity to receive the
|
|
||||||
Corresponding Source of your version by providing access to the
|
|
||||||
Corresponding Source from a network server at no charge, through some
|
|
||||||
standard or customary means of facilitating copying of software. This
|
|
||||||
Corresponding Source shall include the Corresponding Source for any
|
|
||||||
work covered by version 3 of the GNU General Public License that is
|
|
||||||
incorporated pursuant to the following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
### 14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the GNU Affero General Public License from time to time. Such new
|
|
||||||
versions will be similar in spirit to the present version, but may
|
|
||||||
differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever
|
|
||||||
published by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future versions
|
|
||||||
of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
### 15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
|
||||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
|
||||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
|
||||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
|
||||||
CORRECTION.
|
|
||||||
|
|
||||||
### 16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
|
||||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
|
||||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
|
||||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
|
||||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
|
||||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
|
||||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
### 17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
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
|
|
||||||
220
README.md
220
README.md
@@ -1,220 +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>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/dw/ua-parser-js?color=red&logo=npm&label=NPM%20DOWNLOADS&style=for-the-badge"></a>
|
|
||||||
<a href="https://www.jsdelivr.com/package/npm/ua-parser-js"><img src="https://img.shields.io/jsdelivr/gh/hw/faisalman/ua-parser-js?logo=jsdelivr&style=for-the-badge"></a>
|
|
||||||
<a href="https://github.com/faisalman/ua-parser-js"><img src="https://img.shields.io/github/stars/faisalman/ua-parser-js?color=yellow&logo=github&style=for-the-badge"></a>
|
|
||||||
<a href="https://bundlephobia.com/package/ua-parser-js@1.0.35"><img src="https://img.shields.io/bundlephobia/minzip/ua-parser-js?logo=hackthebox&logoColor=white&style=for-the-badge"/></a>
|
|
||||||
<a href="https://github.com/faisalman/ua-parser-js/graphs/contributors"><img src="https://img.shields.io/github/contributors/faisalman/ua-parser-js?color=purple&logo=githubsponsors&style=for-the-badge"></a>
|
|
||||||
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/v/ua-parser-js.svg?logo=npm&color=red&style=for-the-badge"></a>
|
|
||||||
<a href="https://cdnjs.com/libraries/UAParser.js"><img src="https://img.shields.io/cdnjs/v/UAParser.js.svg?color=orange&style=for-the-badge"></a>
|
|
||||||
<img src="https://img.shields.io/ossf-scorecard/github.com/faisalman/ua-parser-js?label=openssf%20scorecard&style=for-the-badge">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# UAParser.js
|
|
||||||
|
|
||||||
The most comprehensive, compact, & up-to-date JavaScript library to detect
|
|
||||||
user's Browser, Engine, OS, CPU, and Device type/model. Runs either in browser
|
|
||||||
(client-side) or node.js (server-side).
|
|
||||||
|
|
||||||
## License Options
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<th colspan="2">Open-Source Editions</th>
|
|
||||||
<th colspan="3">PRO / Commercial Editions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>License options</td>
|
|
||||||
<td>MIT</td>
|
|
||||||
<td>AGPL</td>
|
|
||||||
<td>PRO Personal</td>
|
|
||||||
<td>PRO Business</td>
|
|
||||||
<td>PRO Enterprise</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Browser detection</td>
|
|
||||||
<td><strong title="Basic detection">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>CPU detection</td>
|
|
||||||
<td><strong title="Basic detection">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Device detection</td>
|
|
||||||
<td><strong title="Basic detection">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Engine detection</td>
|
|
||||||
<td><strong title="Basic detection">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>OS detection</td>
|
|
||||||
<td><strong title="Basic detection">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Enhanced detection</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Client Hints support</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extras (Apps, Bots, Libs, Emails, Media Players, etc)</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>CommonJS support</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>ES modules support</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>npm module available</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TypeScript declarations available</td>
|
|
||||||
<td><strong title="Community version">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Allowed for commercial use</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Permissive (non-copyleft) license</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td><strong title="Copyleft license">⛔️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Unlimited use per 1 license</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td><strong title="1 project per 1 license">⚠️</strong></td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1-year support</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>⛔️</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Lifetime updates</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
<td>✅</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Price</td>
|
|
||||||
<td><strong title="Pay as you want">FREE</strong></td>
|
|
||||||
<td><strong title="Pay as you want">FREE</strong></td>
|
|
||||||
<td><strong title="$12 (one-time fee)">$12</strong></td>
|
|
||||||
<td><strong title="$25 (one-time fee)">$25</strong></td>
|
|
||||||
<td><strong title="$500 (one-time fee)">$500</strong></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th align="right" colspan="6">
|
|
||||||
<a target="_blank" href="https://store.faisalman.com/checkout/buy/e236ea87-9b2b-400e-9683-24367f731b35"> GET THE PRO PACKAGES 📥</a>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
## Version 2.0
|
|
||||||
Before upgrading from `v0.7` / `v1.0`, please read [CHANGELOG](CHANGELOG.md) to
|
|
||||||
see what's new & breaking.
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
* v1.0: https://github.com/faisalman/ua-parser-js/tree/1.0.35#documentation
|
|
||||||
* v2.0: https://docs.uaparser.js.org/v2
|
|
||||||
|
|
||||||
# Development
|
|
||||||
|
|
||||||
## Contributors
|
|
||||||
|
|
||||||
Large or small, your contribution is valuable here. Please read [CONTRIBUTING](CONTRIBUTING.md)
|
|
||||||
guide first for the instruction details.
|
|
||||||
|
|
||||||
<a href="https://github.com/faisalman/ua-parser-js/graphs/contributors">
|
|
||||||
<img src="https://contrib.rocks/image?repo=faisalman/ua-parser-js" />
|
|
||||||
</a>
|
|
||||||
|
|
||||||
Made with [contributors-img](https://contrib.rocks).
|
|
||||||
|
|
||||||
## Backers & Sponsors
|
|
||||||
|
|
||||||
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/organizations.svg?avatarHeight=64"></a>
|
|
||||||
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/individuals.svg?avatarHeight=64"></a>
|
|
||||||
@@ -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.
|
|
||||||
17
bower.json
Normal file
17
bower.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "ua-parser-js",
|
||||||
|
"version": "1.0.33",
|
||||||
|
"authors": [
|
||||||
|
"Faisal Salman <f@faisalman.com>"
|
||||||
|
],
|
||||||
|
"private": false,
|
||||||
|
"main": "src/ua-parser.js",
|
||||||
|
"ignore": [
|
||||||
|
"build",
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"test",
|
||||||
|
"tests"
|
||||||
|
],
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
||||||
3
changelog.md
Normal file
3
changelog.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# UAParser.js Changelog
|
||||||
|
|
||||||
|
## Version 0.8.0
|
||||||
8
dist/ua-parser.min.js
vendored
8
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/ua-parser.pack.js
vendored
8
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
21
license.md
Normal file
21
license.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.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.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
4959
package-lock.json
generated
4959
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
Package.describe({
|
Package.describe({
|
||||||
name: 'faisalman:ua-parser-js',
|
name: 'faisalman:ua-parser-js',
|
||||||
version: '2.0.0-beta.2',
|
version: '1.0.33',
|
||||||
summary: 'Lightweight JavaScript-based user-agent string parser',
|
summary: 'Lightweight JavaScript-based user-agent string parser',
|
||||||
git: 'https://github.com/faisalman/ua-parser-js.git',
|
git: 'https://github.com/faisalman/ua-parser-js.git',
|
||||||
documentation: 'readme.md'
|
documentation: 'readme.md'
|
||||||
|
|||||||
110
package.json
Executable file → Normal file
110
package.json
Executable file → Normal file
@@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "2.0.0-beta.2",
|
"version": "1.0.33",
|
||||||
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
|
||||||
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
|
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"user-agent",
|
"user-agent",
|
||||||
"client-hints",
|
|
||||||
"parser",
|
"parser",
|
||||||
"browser",
|
"browser",
|
||||||
"engine",
|
"engine",
|
||||||
@@ -14,11 +13,7 @@
|
|||||||
"device",
|
"device",
|
||||||
"cpu",
|
"cpu",
|
||||||
"jquery-plugin",
|
"jquery-plugin",
|
||||||
"ecosystem:jquery",
|
"ecosystem:jquery"
|
||||||
"ua-parser-js",
|
|
||||||
"browser-detection",
|
|
||||||
"device-detection",
|
|
||||||
"os-detection"
|
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/faisalman/ua-parser-js",
|
"homepage": "https://github.com/faisalman/ua-parser-js",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -39,11 +34,8 @@
|
|||||||
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
|
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
|
||||||
"CESAR RAMOS <c@imagenproactiva.com>",
|
"CESAR RAMOS <c@imagenproactiva.com>",
|
||||||
"Chad Killingsworth <ckillingsworth@jackhenry.com>",
|
"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>",
|
"Cyrille David <cyrille@qonto.eu>",
|
||||||
"Dante <duanjl.china@gmail.com>",
|
|
||||||
"Dario Vladovic <d.vladimyr@gmail.com>",
|
"Dario Vladovic <d.vladimyr@gmail.com>",
|
||||||
"David Annez <david.annez@gmail.com>",
|
"David Annez <david.annez@gmail.com>",
|
||||||
"Davit Barbakadze <jayarjo@gmail.com>",
|
"Davit Barbakadze <jayarjo@gmail.com>",
|
||||||
@@ -66,12 +58,10 @@
|
|||||||
"Faisal Salman <f@faisalman.com>",
|
"Faisal Salman <f@faisalman.com>",
|
||||||
"Frédéric Camblor <fcamblor@gmail.com>",
|
"Frédéric Camblor <fcamblor@gmail.com>",
|
||||||
"Frederik Ring <frederik.ring@gmail.com>",
|
"Frederik Ring <frederik.ring@gmail.com>",
|
||||||
"Garrit Franke <garrit@slashdev.space>",
|
|
||||||
"Gerald Host <me@jacobford.co.uk>",
|
"Gerald Host <me@jacobford.co.uk>",
|
||||||
"Germán M. Bravo <german.mb@gmail.com>",
|
"Germán M. Bravo <german.mb@gmail.com>",
|
||||||
"Grigory Dmitrenko <grigory@snsk.ru>",
|
"Grigory Dmitrenko <grigory@snsk.ru>",
|
||||||
"gulpin <gulping.gulpin@gmail.com>",
|
"gulpin <gulping.gulpin@gmail.com>",
|
||||||
"Hans Ott <hansott@hotmail.be>",
|
|
||||||
"Hendrik Helwich <h.helwich@iplabs.de>",
|
"Hendrik Helwich <h.helwich@iplabs.de>",
|
||||||
"Hermann Ebert <ebbmo@HE.local>",
|
"Hermann Ebert <ebbmo@HE.local>",
|
||||||
"hr6r <hedian@gmail.com>",
|
"hr6r <hedian@gmail.com>",
|
||||||
@@ -79,7 +69,6 @@
|
|||||||
"Ildar Kamalov <i.kamalov@adguard.com>",
|
"Ildar Kamalov <i.kamalov@adguard.com>",
|
||||||
"insanehong <insane.hong@navercorp.com>",
|
"insanehong <insane.hong@navercorp.com>",
|
||||||
"jackpoll <jackpoll123456@gmail.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>",
|
"JBYoshi <12983479+JBYoshi@users.noreply.github.com>",
|
||||||
"Joey Parrish <joeyparrish@google.com>",
|
"Joey Parrish <joeyparrish@google.com>",
|
||||||
@@ -89,14 +78,11 @@
|
|||||||
"Josh Goldberg <joshuakgoldberg@outlook.com>",
|
"Josh Goldberg <joshuakgoldberg@outlook.com>",
|
||||||
"Junki-Ishida <junki_ishida@dwango.co.jp>",
|
"Junki-Ishida <junki_ishida@dwango.co.jp>",
|
||||||
"Kendall Buchanan <kendall@kendagriff.com>",
|
"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>",
|
"Levente Balogh <balogh.levente.hu@gmail.com>",
|
||||||
"Liam Quinn <lquinn@blackberry.com>",
|
"Liam Quinn <lquinn@blackberry.com>",
|
||||||
"Lithin <lithin@webklipper.com>",
|
"Lithin <lithin@webklipper.com>",
|
||||||
"liujunlve <liujunlve@henhaoji.com>",
|
|
||||||
"ll-syber <670159357@qq.com>",
|
"ll-syber <670159357@qq.com>",
|
||||||
"Loris Guignard <loris.guignard@gmail.com>",
|
"Loris Guignard <loris.guignard@gmail.com>",
|
||||||
"Lukas Drgon <lukas.drgon@gmail.com>",
|
"Lukas Drgon <lukas.drgon@gmail.com>",
|
||||||
@@ -111,8 +97,6 @@
|
|||||||
"Max Nordlund <max.nordlund@gmail.com>",
|
"Max Nordlund <max.nordlund@gmail.com>",
|
||||||
"Michael Hess <mhess@connectify.me>",
|
"Michael Hess <mhess@connectify.me>",
|
||||||
"MimyyK <michele.marais@hakisa.com>",
|
"MimyyK <michele.marais@hakisa.com>",
|
||||||
"Mok <mok@moekm.com>",
|
|
||||||
"nabetama <mao.nabeta@gmail.com>",
|
|
||||||
"naoh <naoh.cs03g@nctu.edu.tw>",
|
"naoh <naoh.cs03g@nctu.edu.tw>",
|
||||||
"Nicholas Ionata <nionata@ufl.edu>",
|
"Nicholas Ionata <nionata@ufl.edu>",
|
||||||
"Nikhil Motiani <nikhil.motiani@outlook.com>",
|
"Nikhil Motiani <nikhil.motiani@outlook.com>",
|
||||||
@@ -121,9 +105,7 @@
|
|||||||
"niris <nirisix@gmail.com>",
|
"niris <nirisix@gmail.com>",
|
||||||
"Nobuo Okada <nookada@yahoo-corp.jp>",
|
"Nobuo Okada <nookada@yahoo-corp.jp>",
|
||||||
"o.drapeza <o.drapeza@tinkoff.ru>",
|
"o.drapeza <o.drapeza@tinkoff.ru>",
|
||||||
"Oscar Becerra <oscarbecerra@google.com>",
|
|
||||||
"otakuSiD <otakusid@gmail.com>",
|
"otakuSiD <otakusid@gmail.com>",
|
||||||
"Paris Morgan <paris@8thwall.com>",
|
|
||||||
"patrick-nurt <github@pereira.dk>",
|
"patrick-nurt <github@pereira.dk>",
|
||||||
"Pavel Studeny <studeny@avast.com>",
|
"Pavel Studeny <studeny@avast.com>",
|
||||||
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
|
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
|
||||||
@@ -133,24 +115,19 @@
|
|||||||
"Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>",
|
"Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>",
|
||||||
"Raine Makelainen <raine.makelainen@jolla.com>",
|
"Raine Makelainen <raine.makelainen@jolla.com>",
|
||||||
"Raman Savaryn <homeneartheocean@gmail.com>",
|
"Raman Savaryn <homeneartheocean@gmail.com>",
|
||||||
"Riley Shaw <rileyjshaw@users.noreply.github.com>",
|
|
||||||
"Robert Tod <robert@qubit.com>",
|
"Robert Tod <robert@qubit.com>",
|
||||||
"roman.savarin <roman.savarin@skywindgroup.com>",
|
"roman.savarin <roman.savarin@skywindgroup.com>",
|
||||||
"Ron Korland <ron@testim.io>",
|
"Ron Korland <ron@testim.io>",
|
||||||
"Ross Noble <rosshnoble@gmail.com>",
|
"Ross Noble <rosshnoble@gmail.com>",
|
||||||
"ruicong <466403866@qq.com>",
|
"ruicong <466403866@qq.com>",
|
||||||
"Runar Heggset <rukki093@gmail.com>",
|
|
||||||
"Ryohei Shima <shima01dev@gmail.com>",
|
|
||||||
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
|
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
|
||||||
"sgautrea <shanegautreau@gmail.com>",
|
"sgautrea <shanegautreau@gmail.com>",
|
||||||
"shaharmor <shahar@peer5.com>",
|
|
||||||
"Shane Gautreau <sgautrea@opentext.com>",
|
"Shane Gautreau <sgautrea@opentext.com>",
|
||||||
"Shane Thacker <shane@steadymade.com>",
|
"Shane Thacker <shane@steadymade.com>",
|
||||||
"Shreedhar <shreedhar@uber.com>",
|
"Shreedhar <shreedhar@uber.com>",
|
||||||
"Simon Eisenmann <simon@longsleep.org>",
|
"Simon Eisenmann <simon@longsleep.org>",
|
||||||
"Simon Lang <me@simonlang.org>",
|
"Simon Lang <me@simonlang.org>",
|
||||||
"Stiekel <histkc@gmail.com>",
|
"Stiekel <histkc@gmail.com>",
|
||||||
"sunny-mwx <30586210+sunny-mwx@users.noreply.github.com>",
|
|
||||||
"sUP <dani3l@gmail.com>",
|
"sUP <dani3l@gmail.com>",
|
||||||
"Sylvain Gizard <sylvain.gizard@gmail.com>",
|
"Sylvain Gizard <sylvain.gizard@gmail.com>",
|
||||||
"szchenghuang <szchenghuang@gmail.com>",
|
"szchenghuang <szchenghuang@gmail.com>",
|
||||||
@@ -158,85 +135,60 @@
|
|||||||
"Tony Tomarchio <tony@tomarchio.cc>",
|
"Tony Tomarchio <tony@tomarchio.cc>",
|
||||||
"Ulrich Schmidt <u.schmidt@velian.de>",
|
"Ulrich Schmidt <u.schmidt@velian.de>",
|
||||||
"Vadim Kurachevsky <vadim@hmvs.org>",
|
"Vadim Kurachevsky <vadim@hmvs.org>",
|
||||||
"Varun Sharma <varunsh@stepsecurity.io>",
|
|
||||||
"XhmikosR <xhmikosr@gmail.com>",
|
|
||||||
"Yılmaz <yilmazdemir36@gmail.com>",
|
"Yılmaz <yilmazdemir36@gmail.com>",
|
||||||
"yuanyang <work_yuanyang@163.com>",
|
"yuanyang <work_yuanyang@163.com>",
|
||||||
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
|
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
|
||||||
"Zach Bjornson <zbbjornson@gmail.com>",
|
"Zach Bjornson <zbbjornson@gmail.com>"
|
||||||
"Ziding Zhang <zidingz@gmail.com>"
|
|
||||||
],
|
],
|
||||||
"type": "commonjs",
|
"main": "src/ua-parser.js",
|
||||||
"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": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./script/build-dist.sh && ./script/build-module.js",
|
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle",
|
||||||
"build+test": "npm run build && npm run test",
|
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
|
||||||
"fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync",
|
"test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js",
|
||||||
"test": "./script/test-all.sh",
|
"verup": "node ./node_modules/verup",
|
||||||
"test:dts-lint": "tsd --typings src/main/ua-parser.d.ts --files test/dts-test.ts",
|
"version": "node ./node_modules/verup 0"
|
||||||
"test:eslint": "eslint src && eslint script",
|
},
|
||||||
"test:jshint": "jshint src/main",
|
"verup": {
|
||||||
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
|
"files": [
|
||||||
"test:mocha": "mocha -R list test/mocha*js",
|
"bower.json",
|
||||||
"test:playwright": "playwright test"
|
"package.js",
|
||||||
|
"src/ua-parser.js"
|
||||||
|
],
|
||||||
|
"regs": [
|
||||||
|
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
|
||||||
|
"^(\\/?\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/parser": "7.15.8",
|
"@babel/parser": "7.15.8",
|
||||||
"@babel/traverse": "7.23.2",
|
"@babel/traverse": "7.15.4",
|
||||||
"@jazzer.js/core": "^1.4.0",
|
"jshint": "~2.12.0",
|
||||||
"@playwright/test": "~1.32.2",
|
|
||||||
"jshint": "~2.13.6",
|
|
||||||
"mocha": "~8.2.0",
|
"mocha": "~8.2.0",
|
||||||
"requirejs": "2.3.2",
|
"requirejs": "^2.3.2",
|
||||||
"safe-regex": "^2.1.1",
|
"safe-regex": "^2.1.1",
|
||||||
"tsd": "^0.29.0",
|
"uglify-js": "~3.12.0",
|
||||||
"uglify-js": "~3.12.0"
|
"verup": "^1.3.x"
|
||||||
},
|
},
|
||||||
"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": "AGPL-3.0-or-later",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"dist": "dist",
|
"dist": "dist",
|
||||||
"script": "script",
|
|
||||||
"src": "src",
|
"src": "src",
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
||||||
"demo": "https://uaparser.js.org",
|
"demo": "https://faisalman.github.io/ua-parser-js",
|
||||||
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.pack.js",
|
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@@ -245,10 +197,6 @@
|
|||||||
{
|
{
|
||||||
"type": "paypal",
|
"type": "paypal",
|
||||||
"url": "https://paypal.me/faisalman"
|
"url": "https://paypal.me/faisalman"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/faisalman"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
359
readme.md
Normal file
359
readme.md
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/logo.png" width="256" height="256">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://travis-ci.org/faisalman/ua-parser-js"><img src="https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master"></a>
|
||||||
|
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/v/ua-parser-js.svg"></a>
|
||||||
|
<a href="https://www.npmjs.com/package/ua-parser-js"><img src="https://img.shields.io/npm/dw/ua-parser-js.svg"></a>
|
||||||
|
<a href="https://www.jsdelivr.com/package/npm/ua-parser-js"><img src="https://data.jsdelivr.com/v1/package/npm/ua-parser-js/badge"></a>
|
||||||
|
<a href="https://cdnjs.com/libraries/UAParser.js"><img src="https://img.shields.io/cdnjs/v/UAParser.js.svg"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# UAParser.js
|
||||||
|
|
||||||
|
JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data with relatively small footprint (~17KB minified, ~6KB gzipped) that can be used either in browser (client-side) or node.js (server-side).
|
||||||
|
|
||||||
|
* Author : Faisal Salman <<f@faisalman.com>>
|
||||||
|
* Demo : https://faisalman.github.io/ua-parser-js
|
||||||
|
* Source : https://github.com/faisalman/ua-parser-js
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
### UAParser([user-agent][,extensions])
|
||||||
|
typeof `user-agent` "string".
|
||||||
|
|
||||||
|
typeof `extensions` "array".
|
||||||
|
|
||||||
|
In The Browser environment you dont need to pass the user-agent string to the function, you can just call the funtion and it should automatically get the string from the `window.navigator.userAgent`, but that is not the case in nodejs. The user-agent string must be passed in nodejs for the function to work.
|
||||||
|
Usually you can find the user agent in:
|
||||||
|
`request.headers["user-agent"]`.
|
||||||
|
|
||||||
|
|
||||||
|
## Constructor
|
||||||
|
When you call `UAParser` with the `new` keyword `UAParser` will return a new instance with an empty result object, you have to call one of the available methods to get the information from the user-agent string.
|
||||||
|
Like so:
|
||||||
|
* `new UAParser([uastring][,extensions])`
|
||||||
|
```js
|
||||||
|
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
|
||||||
|
console.log(parser); // {}
|
||||||
|
let parserResults = parser.getResult();
|
||||||
|
console.log(parserResults);
|
||||||
|
/** {
|
||||||
|
"ua": "",
|
||||||
|
"browser": {},
|
||||||
|
"engine": {},
|
||||||
|
"os": {},
|
||||||
|
"device": {},
|
||||||
|
"cpu": {}
|
||||||
|
} */
|
||||||
|
```
|
||||||
|
|
||||||
|
When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
|
||||||
|
* `UAParser([uastring][,extensions])`
|
||||||
|
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
#### Methods table
|
||||||
|
The methods are self explanatory, here's a small overview on all the available methods:
|
||||||
|
* `getResult()` - returns all function object calls, user-agent string, browser info, cpu, device, engine, os:
|
||||||
|
`{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`.
|
||||||
|
|
||||||
|
* `getBrowser()` - returns the browser name and version.
|
||||||
|
* `getDevice()` - returns the device model, type, vendor.
|
||||||
|
* `getEngine()` - returns the current browser engine name and version.
|
||||||
|
* `getOS()` - returns the running operating system name and version.
|
||||||
|
* `getCPU()` - returns CPU architectural design name.
|
||||||
|
* `getUA()` - returns the user-agent string.
|
||||||
|
* `setUA(user-agent)` - set a custom user-agent to be parsed.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
* `getResult()`
|
||||||
|
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
|
||||||
|
|
||||||
|
* `getBrowser()`
|
||||||
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Possible 'browser.name':
|
||||||
|
2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG,
|
||||||
|
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
|
||||||
|
Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
|
||||||
|
Dolphin, Doris, DuckDuckGo, Edge, Electron, Epiphany, Facebook, Falkon, Fennec,
|
||||||
|
Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Huawei Browser,
|
||||||
|
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel, Instagram,
|
||||||
|
Iridium, Iron, Jasmine, K-Meleon, Kindle, Klar, Konqueror, LBBROWSER, Line,
|
||||||
|
LinkedIn, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon,
|
||||||
|
MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront, NetSurf, Netfront,
|
||||||
|
Netscape, NokiaBrowser, Obigo, Oculus Browser, OmniWeb, Opera Coast,
|
||||||
|
Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, Polaris, Puffin, QQ,
|
||||||
|
QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, Sailfish Browser,
|
||||||
|
Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, SlimBrowser, Swiftfox,
|
||||||
|
Tesla, Tizen Browser, UCBrowser, UP.Browser, Vivaldi, Waterfox, WeChat, Weibo,
|
||||||
|
Yandex, baidu, iCab, w3m, Whale Browser...
|
||||||
|
|
||||||
|
# 'browser.version' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getDevice()`
|
||||||
|
* returns `{ model: '', type: '', vendor: '' }`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Possible 'device.type':
|
||||||
|
console, mobile, tablet, smarttv, wearable, embedded
|
||||||
|
|
||||||
|
##########
|
||||||
|
# NOTE: 'desktop' is not a possible device type.
|
||||||
|
# UAParser only reports info directly available from the UA string, which is not the case for 'desktop' device type.
|
||||||
|
# If you wish to detect desktop devices, you must handle the needed logic yourself.
|
||||||
|
# You can read more about it in this issue: https://github.com/faisalman/ua-parser-js/issues/182
|
||||||
|
##########
|
||||||
|
|
||||||
|
# Possible 'device.vendor':
|
||||||
|
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
|
||||||
|
Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG,
|
||||||
|
Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya,
|
||||||
|
Palm, Panasonic, Pebble, Polytron, Realme, RIM, Roku, Samsung, Sharp, Siemens,
|
||||||
|
Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
|
||||||
|
|
||||||
|
# 'device.model' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getEngine()`
|
||||||
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Possible 'engine.name'
|
||||||
|
Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront,
|
||||||
|
NetSurf, Presto, Tasman, Trident, w3m, WebKit
|
||||||
|
|
||||||
|
# 'engine.version' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getOS()`
|
||||||
|
* returns `{ name: '', version: '' }`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Possible 'os.name'
|
||||||
|
AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
|
||||||
|
Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS,
|
||||||
|
Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HarmonyOS, HP-UX, Hurd, iOS, Joli, KaiOS,
|
||||||
|
Linpus, Linspire,Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix,
|
||||||
|
Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS,
|
||||||
|
Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS, RISC OS, Sabayon,
|
||||||
|
Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix,
|
||||||
|
VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
|
||||||
|
|
||||||
|
# 'os.version' determined dynamically
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getCPU()`
|
||||||
|
* returns `{ architecture: '' }`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Possible 'cpu.architecture'
|
||||||
|
68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
|
||||||
|
```
|
||||||
|
|
||||||
|
* `getUA()`
|
||||||
|
* returns UA string of current instance
|
||||||
|
|
||||||
|
* `setUA(uastring)`
|
||||||
|
* set UA string to be parsed
|
||||||
|
* returns current instance
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
## Using HTML
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="ua-parser.min.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var parser = new UAParser();
|
||||||
|
console.log(parser.getResult());
|
||||||
|
/*
|
||||||
|
/// This will print an object structured like this:
|
||||||
|
{
|
||||||
|
ua: "",
|
||||||
|
browser: {
|
||||||
|
name: "",
|
||||||
|
version: "",
|
||||||
|
major: "" //@deprecated
|
||||||
|
},
|
||||||
|
engine: {
|
||||||
|
name: "",
|
||||||
|
version: ""
|
||||||
|
},
|
||||||
|
os: {
|
||||||
|
name: "",
|
||||||
|
version: ""
|
||||||
|
},
|
||||||
|
device: {
|
||||||
|
model: "",
|
||||||
|
type: "",
|
||||||
|
vendor: ""
|
||||||
|
},
|
||||||
|
cpu: {
|
||||||
|
architecture: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// Default result depends on current window.navigator.userAgent value
|
||||||
|
|
||||||
|
// Now let's try a custom user-agent string as an example
|
||||||
|
var uastring1 = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 Chrome/15.0.874.106 Safari/535.2";
|
||||||
|
parser.setUA(uastring1);
|
||||||
|
var result = parser.getResult();
|
||||||
|
// You can also use UAParser constructor directly without having to create an instance:
|
||||||
|
// var result = UAParser(uastring1);
|
||||||
|
|
||||||
|
console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"}
|
||||||
|
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
|
||||||
|
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
|
||||||
|
console.log(result.os.version); // "11.10"
|
||||||
|
console.log(result.engine.name); // "WebKit"
|
||||||
|
console.log(result.cpu.architecture); // "amd64"
|
||||||
|
|
||||||
|
// Do some other tests
|
||||||
|
var uastring2 = "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)";
|
||||||
|
console.log(parser.setUA(uastring2).getBrowser().name); // "Konqueror"
|
||||||
|
console.log(parser.getOS()); // {name: "OpenBSD", version: undefined}
|
||||||
|
console.log(parser.getEngine()); // {name: "KHTML", version: "4.1.4"}
|
||||||
|
|
||||||
|
var uastring3 = 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Version/7.1.0.7 Safari/534.11';
|
||||||
|
console.log(parser.setUA(uastring3).getDevice().model); // "PlayBook"
|
||||||
|
console.log(parser.getOS()) // {name: "RIM Tablet OS", version: "1.0.0"}
|
||||||
|
console.log(parser.getBrowser().name); // "Safari"
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using node.js
|
||||||
|
|
||||||
|
Note: Device information is not available in the NodeJS environment.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install ua-parser-js
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
var http = require('http');
|
||||||
|
var parser = require('ua-parser-js');
|
||||||
|
|
||||||
|
http.createServer(function (req, res) {
|
||||||
|
// get user-agent header
|
||||||
|
var ua = parser(req.headers['user-agent']);
|
||||||
|
// write the result as response
|
||||||
|
res.end(JSON.stringify(ua, null, ' '));
|
||||||
|
})
|
||||||
|
.listen(1337, '127.0.0.1');
|
||||||
|
|
||||||
|
console.log('Server running at http://127.0.0.1:1337/');
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using TypeScript
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install --save @types/ua-parser-js
|
||||||
|
# Download TS type definition from DefinitelyTyped repository:
|
||||||
|
# https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using jQuery/Zepto ($.ua)
|
||||||
|
|
||||||
|
Although written in vanilla js, this library will automatically detect if jQuery/Zepto is present and create `$.ua` object (with values based on its User-Agent) along with `window.UAParser` constructor. To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Say we are in a browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
|
||||||
|
|
||||||
|
// Get the details
|
||||||
|
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"
|
||||||
|
|
||||||
|
// Now lets try to reset to another custom user-agent
|
||||||
|
$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13');
|
||||||
|
|
||||||
|
// 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
|
||||||
|
|
||||||
|
// Add class to <body> tag
|
||||||
|
// <body class="ua-browser-safari ua-devicetype-tablet">
|
||||||
|
$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using Extension
|
||||||
|
|
||||||
|
* `UAParser([uastring,] extensions)`
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Example:
|
||||||
|
var myOwnListOfBrowsers = [
|
||||||
|
[/(mybrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]
|
||||||
|
];
|
||||||
|
var myParser = new UAParser({ browser: myOwnListOfBrowsers });
|
||||||
|
var myUA = 'Mozilla/5.0 MyBrowser/1.3';
|
||||||
|
console.log(myParser.setUA(myUA).getBrowser()); // {name: "MyBrowser", version: "1.3"}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Development
|
||||||
|
|
||||||
|
## Sponsors
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/backers.svg?avatarHeight=64" height="80"/></a> <a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/sponsors.svg?avatarHeight=64" height="80"/></a>
|
||||||
|
|
||||||
|
<a href="https://www.paypal.me/faisalman/"><img src="https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg" height="40"></a>
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
<a href="https://github.com/faisalman/ua-parser-js/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=faisalman/ua-parser-js" />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
Made with [contributors-img](https://contrib.rocks).
|
||||||
|
|
||||||
|
## How To Contribute
|
||||||
|
|
||||||
|
* Fork and clone this repository
|
||||||
|
* Make some changes as required
|
||||||
|
* Write unit test to showcase its functionality
|
||||||
|
* Run the test suites to make sure it's not breaking anything `$ npm test`
|
||||||
|
* Submit a pull request under `develop` branch
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.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.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 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
|
|
||||||
5
security.md
Normal file
5
security.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Please report security issues to `f@faisalman.com`
|
||||||
@@ -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>
|
|
||||||
AGPLv3 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>
|
|
||||||
AGPLv3 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>
|
|
||||||
AGPLv3 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>
|
|
||||||
AGPLv3 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
@@ -9,26 +9,6 @@
|
|||||||
"major" : "undefined"
|
"major" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Alipay",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; U; Android 10; zh-CN; V2034A Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.2.33 Mobile Safari/537.36 UCBS/3.22.2.33_211025173018 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:WIFI,ws:360|0|2.0) AliApp(AP/10.2.51.7100) AlipayClient/10.2.51.7100 Language/zh-Hans useStatusBar/true isConcaveScreen/true Region/CNAriver/1.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Alipay",
|
|
||||||
"version" : "10.2.51.7100",
|
|
||||||
"major" : "10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Alipay",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 10; VOG-AL00 Build/HUAWEIVOG-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/105.0.5195.148 MYWeb/0.2.103.0_20230131112530 UWS/3.22.2.9999 UCBS/3.22.2.9999_220000000000 Mobile Safari/537.36 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:WIFI,ws:360|0|3.0) AliApp(AP/10.3.50.9999) AlipayClient/10.3.50.9999 Language/en isConcaveScreen/true Region/CN ProductType/devAriver/1.0.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Alipay",
|
|
||||||
"version" : "10.3.50.9999",
|
|
||||||
"major" : "10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Android Browser on Galaxy Nexus",
|
"desc" : "Android Browser on Galaxy Nexus",
|
||||||
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
"ua" : "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
|
||||||
@@ -84,7 +64,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36",
|
"ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Samsung Internet",
|
"name" : "Samsung Browser",
|
||||||
"version" : "3.0",
|
"version" : "3.0",
|
||||||
"major" : "3"
|
"major" : "3"
|
||||||
}
|
}
|
||||||
@@ -114,7 +94,7 @@
|
|||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Avant",
|
"name" : "Avant ",
|
||||||
"version" : "undefined",
|
"version" : "undefined",
|
||||||
"major" : "undefined"
|
"major" : "undefined"
|
||||||
}
|
}
|
||||||
@@ -144,71 +124,11 @@
|
|||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Baidu",
|
"name" : "baidubrowser",
|
||||||
"version" : "1.x",
|
"version" : "1.x",
|
||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Baidu",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 9; Redmi Note 5 Build/PKQ1.180904.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 bdbrowser/6.4.0.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "6.4.0.4",
|
|
||||||
"major" : "6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Baidu",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.4.9999.1900 Safari/537.31 BDSpark/26.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "26.4",
|
|
||||||
"major" : "26"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Baidu",
|
|
||||||
"ua" : "Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) BaiduHD/5.4.0.0 Mobile/10A406 Safari/8536.25",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "5.4.0.0",
|
|
||||||
"major" : "5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "BaiDu Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 BIDUBrowser/8.7 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "8.7",
|
|
||||||
"major" : "8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "baidu app on iOS",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16C101 main%2F1.0 baiduboxapp/11.12.0.18 (Baidu; P2 12.1.2)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "11.12.0.18",
|
|
||||||
"major" : "11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "baidu app on Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 8.1.0; BKK-AL10 Build/HONORBKK-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.83 Mobile Safari/537.36 T7/11.11 baiduboxapp/11.11.0.0 (Baidu; P1 8.1.0)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Baidu",
|
|
||||||
"version" : "11.11.0.0",
|
|
||||||
"major" : "11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Bolt",
|
"desc" : "Bolt",
|
||||||
"ua" : "Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.862 Version/3.0 Safari/523.15",
|
"ua" : "Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.862 Version/3.0 Safari/523.15",
|
||||||
@@ -279,46 +199,6 @@
|
|||||||
"major" : "100"
|
"major" : "100"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Chrome 112.0 on Win10",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Chrome",
|
|
||||||
"version" : "112.0.0.0",
|
|
||||||
"major" : "112"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Chrome 112.0 on macOS",
|
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Chrome",
|
|
||||||
"version" : "112.0.0.0",
|
|
||||||
"major" : "112"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Chrome 111.0 on Linux",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Chrome",
|
|
||||||
"version" : "111.0.0.0",
|
|
||||||
"major" : "111"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Chrome 111.0 on ChromeOS",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Chrome",
|
|
||||||
"version" : "111.0.0.0",
|
|
||||||
"major" : "111"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Chrome Headless",
|
"desc" : "Chrome Headless",
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36",
|
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36",
|
||||||
@@ -354,7 +234,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
|
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Mobile Chrome",
|
"name" : "Chrome",
|
||||||
"version" : "19.0.1084.60",
|
"version" : "19.0.1084.60",
|
||||||
"major" : "19"
|
"major" : "19"
|
||||||
}
|
}
|
||||||
@@ -374,7 +254,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7",
|
"ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Mobile Chrome",
|
"name" : "Chrome",
|
||||||
"version" : "16.0.912.75",
|
"version" : "16.0.912.75",
|
||||||
"major" : "16"
|
"major" : "16"
|
||||||
}
|
}
|
||||||
@@ -509,26 +389,6 @@
|
|||||||
"major" : "undefined"
|
"major" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Klarna in-App Browser for iOS",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Klarna/23.36.223",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Klarna",
|
|
||||||
"version" : "23.36.223",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Klarna in-App Browser for Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 12; moto g(60)s Build/S3RLS32.114-25-13; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 Klarna/23.36.215",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Klarna",
|
|
||||||
"version" : "23.36.215",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Instagram in-App Browser for iOS",
|
"desc" : "Instagram in-App Browser for iOS",
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 142.0.0.22.109 (iPhone12,5; iOS 14_1; en_US; en-US; scale=3.00; 1242x2688; 214888322) NW/1",
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 142.0.0.22.109 (iPhone12,5; iOS 14_1; en_US; en-US; scale=3.00; 1242x2688; 214888322) NW/1",
|
||||||
@@ -648,16 +508,6 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "HeyTap",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.61 Safari/537.36 HeyTapBrowser/40.8.10.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "HeyTap",
|
|
||||||
"version" : "40.8.10.1",
|
|
||||||
"major" : "40"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "HuaweiBrowser",
|
"desc" : "HuaweiBrowser",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00;HMSCore/4.0.0 GMS/10.4 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
|
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00;HMSCore/4.0.0 GMS/10.4 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
|
||||||
@@ -808,26 +658,6 @@
|
|||||||
"major" : "5"
|
"major" : "5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Smart Lenovo Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.0.10171 SLBChan/8",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Smart Lenovo Browser",
|
|
||||||
"version" : "8.0.0.10171",
|
|
||||||
"major" : "8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Smart Lenovo Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 SLBrowser/9.0.0.9011 SLBChan/10",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Smart Lenovo Browser",
|
|
||||||
"version" : "9.0.0.9011",
|
|
||||||
"major" : "9"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "LINE on Android",
|
"desc" : "LINE on Android",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB",
|
"ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB",
|
||||||
@@ -928,16 +758,6 @@
|
|||||||
"major" : "4"
|
"major" : "4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Mobile Safari",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/604.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Mobile Safari",
|
|
||||||
"version" : "undefined",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Mosaic",
|
"desc" : "Mosaic",
|
||||||
"ua" : "NCSA_Mosaic/2.6 (X11; SunOS 4.1.3 sun4m)",
|
"ua" : "NCSA_Mosaic/2.6 (X11; SunOS 4.1.3 sun4m)",
|
||||||
@@ -1138,26 +958,6 @@
|
|||||||
"major" : "12"
|
"major" : "12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Opera GX on Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.168 Mobile Safari/537.36 OPX/2",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Opera GX",
|
|
||||||
"version" : "2",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Opera GX on Windows",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.50747 OPRGX/60.0.3255.50747",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Opera GX",
|
|
||||||
"version" : "60.0.3255.50747",
|
|
||||||
"major" : "60"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Opera Tablet",
|
"desc" : "Opera Tablet",
|
||||||
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
|
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
|
||||||
@@ -1264,60 +1064,20 @@
|
|||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Safari",
|
"name" : "Safari",
|
||||||
"version" : "1",
|
"version" : "2.0.4",
|
||||||
"major" : "1"
|
"major" : "2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Samsung Internet for Android",
|
"desc" : "Samsung Browser",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G925A Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36",
|
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G925A Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Samsung Internet",
|
"name" : "Samsung Browser",
|
||||||
"version" : "4.0",
|
"version" : "4.0",
|
||||||
"major" : "4"
|
"major" : "4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Samsung Internet for Tizen Mobile",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Tizen 2.3; SAMSUNG SM-Z130H) AppleWebKit/537.3 (KHTML, like Gecko) SamsungBrowser/1.0 Mobile Safari/537.3",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Samsung Internet",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Samsung Internet for Smart-TV",
|
|
||||||
"ua" : "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Samsung Internet",
|
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Samsung Internet for Gear VR",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925K Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile VR Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Samsung Internet",
|
|
||||||
"version" : "4.0",
|
|
||||||
"major" : "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Samsung Internet in Redmi 8A",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 10; Redmi 8A) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/23.0 Chrome/115.0.0.0 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Samsung Internet",
|
|
||||||
"version" : "23.0",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "SeaMonkey",
|
"desc" : "SeaMonkey",
|
||||||
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre",
|
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre",
|
||||||
@@ -1518,36 +1278,6 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Mac",
|
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.88 Safari/537.36 Vivaldi/2.4.1488.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Vivaldi",
|
|
||||||
"version" : "2.4.1488.36",
|
|
||||||
"major" : "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivo Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 13; 23049RAD8C; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.141 Mobile Safari/537.36 VivoBrowser/16.7.1.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Vivo Browser",
|
|
||||||
"version" : "16.7.1.1",
|
|
||||||
"major" : "16"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Viera",
|
|
||||||
"ua" : "HbbTV/1.2.1 (;Panasonic;VIERA 2015;3.014;a001-003 4000-0000;)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "VIERA",
|
|
||||||
"version" : "undefined",
|
|
||||||
"major" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Yandex",
|
"desc" : "Yandex",
|
||||||
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.0.1084.5402 Chrome/19.0.1084.5402 Safari/536.5",
|
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.0.1084.5402 Chrome/19.0.1084.5402 Safari/536.5",
|
||||||
@@ -1558,66 +1288,6 @@
|
|||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Yandex",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 11; M2101K7AG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.125 YaApp_Android/22.70 YaSearchBrowser/22.70 BroPP/1.0 SA/3 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "22.70",
|
|
||||||
"major" : "22"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Yandex",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 YaBrowser/23.3.0.2246 Yowser/2.5 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "23.3.0.2246",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Yandex on Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 13; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.76 YaBrowser/21.3.4.59 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "21.3.4.59",
|
|
||||||
"major" : "21"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Yandex on iPhone",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 YaBrowser/23.3.3.330 Mobile/15E148 Safari/604.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "23.3.3.330",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Yandex on iPad",
|
|
||||||
"ua" : "Mozilla/5.0 (iPad; CPU OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 YaBrowser/23.3.3.330 Mobile/15E148 Safari/605.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "23.3.3.330",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Yandex on iPod",
|
|
||||||
"ua" : "Mozilla/5.0 (iPod touch; CPU iPhone 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 YaBrowser/23.3.3.330 Mobile/15E148 Safari/605.1",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Yandex",
|
|
||||||
"version" : "23.3.3.330",
|
|
||||||
"major" : "23"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Puffin",
|
"desc" : "Puffin",
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP",
|
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP",
|
||||||
@@ -1628,16 +1298,6 @@
|
|||||||
"major" : "6"
|
"major" : "6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Puffin",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 7.1.1; ZTE BLADE A0620 Build/NMF26F; ru-ru) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36 Puffin/9.2.0.50586AP",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Puffin",
|
|
||||||
"version" : "9.2.0.50586AP",
|
|
||||||
"major" : "9"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Microsoft Edge 0.1",
|
"desc" : "Microsoft Edge 0.1",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
|
||||||
@@ -1723,27 +1383,17 @@
|
|||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46",
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Mobile Firefox",
|
"name" : "Firefox",
|
||||||
"version" : "1.1",
|
"version" : "1.1",
|
||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Firefox on iOS",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/112.0 Mobile/15E148 Safari/605.1.15",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Mobile Firefox",
|
|
||||||
"version" : "112.0",
|
|
||||||
"major" : "112"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Firefox iOS using iPad",
|
"desc" : "Firefox iOS using iPad",
|
||||||
"ua" : "Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",
|
"ua" : "Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Mobile Firefox",
|
"name" : "Firefox",
|
||||||
"version" : "1.0",
|
"version" : "1.0",
|
||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
@@ -1768,12 +1418,32 @@
|
|||||||
"major" : "6"
|
"major" : "6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "baidu app on iOS",
|
||||||
|
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16C101 main%2F1.0 baiduboxapp/11.12.0.18 (Baidu; P2 12.1.2)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "baiduboxapp",
|
||||||
|
"version" : "11.12.0.18",
|
||||||
|
"major" : "11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc" : "baidu app on Android",
|
||||||
|
"ua" : "Mozilla/5.0 (Linux; Android 8.1.0; BKK-AL10 Build/HONORBKK-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.83 Mobile Safari/537.36 T7/11.11 baiduboxapp/11.11.0.0 (Baidu; P1 8.1.0)",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "baiduboxapp",
|
||||||
|
"version" : "11.11.0.0",
|
||||||
|
"major" : "11"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "WeChat Desktop for Windows Built-in Browser",
|
"desc" : "WeChat Desktop for Windows Built-in Browser",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400",
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "WeChat",
|
"name" : "WeChat(Win) Desktop",
|
||||||
"version" : "3.43.901.400",
|
"version" : "3.43.901.400",
|
||||||
"major" : "3"
|
"major" : "3"
|
||||||
}
|
}
|
||||||
@@ -1783,7 +1453,7 @@
|
|||||||
"ua" : "mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/53.0.2785.116 safari/537.36 qbcore/4.0.1301.400 qqbrowser/9.0.2524.400 mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/81.0.4044.138 safari/537.36 nettype/wifi micromessenger/7.0.20.1781(0x6700143b) windowswechat",
|
"ua" : "mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/53.0.2785.116 safari/537.36 qbcore/4.0.1301.400 qqbrowser/9.0.2524.400 mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/81.0.4044.138 safari/537.36 nettype/wifi micromessenger/7.0.20.1781(0x6700143b) windowswechat",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "WeChat",
|
"name" : "WeChat(Win) Desktop",
|
||||||
"version" : "4.0.1301.400",
|
"version" : "4.0.1301.400",
|
||||||
"major" : "4"
|
"major" : "4"
|
||||||
}
|
}
|
||||||
@@ -1813,19 +1483,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0",
|
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Sogou Explorer",
|
"name" : "MetaSr"
|
||||||
"version" : "1.0",
|
|
||||||
"major" : "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Sogou Mobile Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 SogouMSE,SogouMobileBrowser/3.7.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Sogou Mobile",
|
|
||||||
"version" : "3.7.4",
|
|
||||||
"major" : "3"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1836,6 +1494,16 @@
|
|||||||
"name" : "LBBROWSER"
|
"name" : "LBBROWSER"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"desc" : "BaiDu Browser",
|
||||||
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 BIDUBrowser/8.7 Safari/537.36",
|
||||||
|
"expect" :
|
||||||
|
{
|
||||||
|
"name" : "BIDUBrowser",
|
||||||
|
"version" : "8.7",
|
||||||
|
"major" : "8"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"desc" : "2345 Browser",
|
"desc" : "2345 Browser",
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116",
|
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116",
|
||||||
@@ -1959,117 +1627,5 @@
|
|||||||
"version": "9.0",
|
"version": "9.0",
|
||||||
"major" : "9"
|
"major" : "9"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "KakaoTalk App Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 12; SM-G988N Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.79 Mobile Safari/537.36;KAKAOTALK 2409760",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "KAKAOTALK",
|
|
||||||
"version": "2409760",
|
|
||||||
"major" : "2409760"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "KakaoStory App Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 12; SM-G988N Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.79 Mobile Safari/537.36 KAKAOSTORY/6.8.3_21046",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "KAKAOSTORY",
|
|
||||||
"version": "6.8.3_21046",
|
|
||||||
"major" : "6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "KakaoTalk App iOS",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU; iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 BizWebView KAKAOTALK 9.7.6",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "KAKAOTALK",
|
|
||||||
"version": "9.7.6",
|
|
||||||
"major" : "9"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Naver App Android",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 12; SM-G988N Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.232 Whale/1.0.0.0 Crosswalk/26.90.3.21 Mobile Safari/537.36 NAVER(inapp; search; 1010; 11.11.2)",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "NAVER",
|
|
||||||
"version": "11.11.2",
|
|
||||||
"major" : "11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Naver App iOS",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/605.1 NAVER(inapp; search; 720; 10.25.0; 11PRO)",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "NAVER",
|
|
||||||
"version": "10.25.0",
|
|
||||||
"major" : "10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "TikTok",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 11; 21061119AG Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile Safari/537.36 trill_2022109040 JsSdk/1.0 NetType/MOBILE Channel/googleplay AppName/musical_ly app_version/21.9.4 ByteLocale/ru-RU ByteFullLocale/ru-RU Region/KG BytedanceWebview/d8a21c6",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "TikTok",
|
|
||||||
"version": "21.9.4",
|
|
||||||
"major" : "21"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "TikTok",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 musical_ly_21.1.0 JsSdk/2.0 NetType/4G Channel/App Store ByteLocale/ru Region/RU ByteFullLocale/ru-RU isDarkMode/1 WKWebView/1 BytedanceWebview/d8a21c6",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "TikTok",
|
|
||||||
"version": "21.1.0",
|
|
||||||
"major" : "21"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "TikTok",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 10; STK-LX1 Build/HONORSTK-LX1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 musical_ly_2022803040 JsSdk/1.0 NetType/WIFI Channel/huaweiadsglobal_int AppName/musical_ly app_version/28.3.4 ByteLocale/en ByteFullLocale/en Region/IQ Spark/1.2.7-alpha.8 AppVersion/28.3.4 PIA/1.5.11 BytedanceWebview/d8a21c6",
|
|
||||||
"expect" : {
|
|
||||||
"name" : "TikTok",
|
|
||||||
"version": "28.3.4",
|
|
||||||
"major" : "28"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Chrome Mobile",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 5X Build/N2G47W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Mobile Chrome",
|
|
||||||
"version" : "58.0.3029.83",
|
|
||||||
"major" : "58"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Firefox Mobile",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 5X Build/N2G47W) AppleWebKit/537.36 (KHTML, like Gecko) FxiOS/7.5b3349 Mobile/14F89 Safari/603.2.4",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Mobile Firefox",
|
|
||||||
"version" : "7.5b3349",
|
|
||||||
"major" : "7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Firefox Mobile",
|
|
||||||
"ua" : "Mozilla/5.0 (Android 5.0; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Mobile Firefox",
|
|
||||||
"version" : "41.0",
|
|
||||||
"major" : "41"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Snapchat",
|
|
||||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Snapchat/12.33.0.36 (like Safari/8614.1.25.0.31, panda)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Snapchat",
|
|
||||||
"version" : "12.33.0.36",
|
|
||||||
"major" : "12"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -23,46 +23,6 @@
|
|||||||
"architecture" : "amd64"
|
"architecture" : "amd64"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Windows",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Windows",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Linux",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "amd64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Vivaldi on Linux",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Vivaldi/6.0.2979.18",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "ia32"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "Xiaomi POCO M2 Pro",
|
|
||||||
"ua": "Mozilla/5.0 (Linux; arm_64; Android 11; POCO M2 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 YaBrowser/22.11.7.42.00 SA/3 Mobile Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"architecture" : "arm64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "win64",
|
"desc" : "win64",
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)",
|
||||||
@@ -167,14 +127,6 @@
|
|||||||
"architecture" : "arm64"
|
"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",
|
"desc" : "Pocket PC",
|
||||||
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
|
||||||
@@ -254,13 +206,5 @@
|
|||||||
{
|
{
|
||||||
"architecture" : "irix64"
|
"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,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));
|
|
||||||
@@ -53,15 +53,6 @@
|
|||||||
"version" : "4.5.4"
|
"version" : "4.5.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "LibWeb",
|
|
||||||
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "LibWeb",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "NetFront",
|
"desc" : "NetFront",
|
||||||
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
||||||
@@ -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 'ua-parser-js';
|
|
||||||
import { CPU, Device, Engine } from 'ua-parser-js/enums';
|
|
||||||
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('ua-parser-js');
|
|
||||||
const { Bots, CLIs, Emails, Modules } = require('ua-parser-js/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('ua-parser-js');
|
|
||||||
const { isAppleSilicon, isChromiumBased } = require('ua-parser-js/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
@@ -80,24 +80,6 @@
|
|||||||
"version" : "10"
|
"version" : "10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "WeChat Desktop for Windows Built-in Browser",
|
|
||||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Windows",
|
|
||||||
"version" : "7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "WeChat Desktop for Windows Built-in Browser major version in 4",
|
|
||||||
"ua" : "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/81.0.4044.138 safari/537.36 nettype/wifi micromessenger/7.0.20.1781(0x6700143b) windowswechat",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Windows",
|
|
||||||
"version" : "7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Windows RT",
|
"desc" : "Windows RT",
|
||||||
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)",
|
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)",
|
||||||
@@ -215,15 +197,6 @@
|
|||||||
"version" : "2.3"
|
"version" : "2.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Tizen 6.0",
|
|
||||||
"ua" : "HbbTV/1.5.1 (+DRM;Samsung;SmartTV2021:UAU7000;T-KSU2EDEUC-1506.0;KantSU2e;urn:samsungtv:familyname:21_KANTSU2E_UHD_BASIC:2021;) Tizen/6.0 (+TVPLUS+SmartHubLink) Chrome/76 LaTivu_1.0.1_2021 RVID/17",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Tizen",
|
|
||||||
"version" : "6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Android",
|
"desc" : "Android",
|
||||||
"ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)",
|
"ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)",
|
||||||
@@ -683,21 +656,12 @@
|
|||||||
"version" : "1.9.2.22-0.1mdv2010.2"
|
"version" : "1.9.2.22-0.1mdv2010.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Chrome OS",
|
|
||||||
"ua" : "Mozilla/5.0 (X11; CrOS x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Safari/537.36",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "Chrome OS",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Chromium OS",
|
"desc" : "Chromium OS",
|
||||||
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
|
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Chrome OS",
|
"name" : "Chromium OS",
|
||||||
"version" : "10575.58.0"
|
"version" : "10575.58.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -782,57 +746,12 @@
|
|||||||
"version" : "undefined"
|
"version" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc": "iOS with FaceBook Mobile App",
|
|
||||||
"ua": "[FBAN/FBIOS;FBAV/283.0.0.44.117;FBBV/238386386;FBDV/iPhone12,1;FBMD/iPhone;FBSN/iOS;FBSV/13.6.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBRV/240127608]",
|
|
||||||
"expect":
|
|
||||||
{
|
|
||||||
"name" : "iOS",
|
|
||||||
"version" : "13.6.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc": "iOS with Slack App",
|
|
||||||
"ua": "com.tinyspeck.chatlyio/23.04.10 (iPhone; iOS 16.4.1; Scale/3.00)",
|
|
||||||
"expect":
|
|
||||||
{
|
|
||||||
"name" : "iOS",
|
|
||||||
"version" : "16.4.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "watchOS",
|
|
||||||
"ua" : "server-bag [Watch OS,8.4,19S546,Watch3,4]",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "watchOS",
|
|
||||||
"version" : "8.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "watchOS",
|
|
||||||
"ua" : "atc/1.0 watchOS/7.4.1 model/Watch3,3 hwp/t8004 build/18T201 (6; dt:155)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "watchOS",
|
|
||||||
"version" : "7.4.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "watchOS",
|
|
||||||
"ua" : "Watch4,3/5.3.8 (16U680)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "watchOS",
|
|
||||||
"version" : "5.3.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "Mac OS on PowerPC",
|
"desc" : "Mac OS on PowerPC",
|
||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "macOS",
|
"name" : "Mac OS",
|
||||||
"version" : "undefined"
|
"version" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -841,7 +760,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
|
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "macOS",
|
"name" : "Mac OS",
|
||||||
"version" : "x.y"
|
"version" : "x.y"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -850,7 +769,7 @@
|
|||||||
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
|
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "macOS",
|
"name" : "Mac OS",
|
||||||
"version" : "x.y"
|
"version" : "x.y"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -859,7 +778,7 @@
|
|||||||
"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",
|
"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" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "macOS",
|
"name" : "Mac OS",
|
||||||
"version" : "10.6.8"
|
"version" : "10.6.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1124,33 +1043,6 @@
|
|||||||
"version" : "undefined"
|
"version" : "undefined"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"desc" : "Panasonic Viera",
|
|
||||||
"ua" : "HbbTV/1.2.1 (;Panasonic;VIERA 2015;3.014;a001-003 4000-0000;)",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "VIERA",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Netrange Smart TV",
|
|
||||||
"ua" : "Mozilla/5.0 (Linux; U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 OPR/46.0.2207.0 LOEWE-SL410/5.2.0.0 HbbTV/1.4.1 (; LOEWE; SL410; LOH/5.2.0.0;;) FVC/3.0 (LOEWE; SL410;) CE-HTML/1.0 Config (L:deu,CC:DEU) NETRANGEMMH",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NETRANGE",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "NetTV 3.2.1",
|
|
||||||
"ua" : "Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.2.1; en) Presto/2.6.33 Version/10.70",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "NETTV",
|
|
||||||
"version" : "3.2.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"desc" : "HP-UX",
|
"desc" : "HP-UX",
|
||||||
"ua" : "Mozilla/5.0 (X11; U; HP-UX 9000/785; es-ES; rv:1.0.1) Gecko/20020827 Netscape/7.0",
|
"ua" : "Mozilla/5.0 (X11; U; HP-UX 9000/785; es-ES; rv:1.0.1) Gecko/20020827 Netscape/7.0",
|
||||||
@@ -1231,14 +1123,5 @@
|
|||||||
"name" : "Linspire",
|
"name" : "Linspire",
|
||||||
"version" : "1.5.0.4"
|
"version" : "1.5.0.4"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "SerenityOS",
|
|
||||||
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
|
||||||
"expect" :
|
|
||||||
{
|
|
||||||
"name" : "SerenityOS",
|
|
||||||
"version" : "undefined"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -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');
|
|
||||||
});
|
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
168
test/test.js
Normal file
168
test/test.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user