Compare commits

..

1 Commits

Author SHA1 Message Date
Faisal Salman
1d776d469b Make it biz 2023-10-05 22:08:02 +07:00
29 changed files with 345 additions and 1011 deletions

View File

@@ -16,54 +16,10 @@
- Provided Extensions submodule `'ua-parser-js/extensions'` - Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'` - 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 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 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 ## Version 0.7.36 / 1.0.36
- Add new browser: Snapchat - Add new browser: Snapchat
- Add new devices: Infinix, Tecno - Add new devices: Infinix, Tecno

View File

@@ -1,4 +1,4 @@
# UAPARSER.JS PRO PERSONAL LICENSE # UAPARSER.JS PRO BUSINESS LICENSE
Version 1, October 2023 Version 1, October 2023
@@ -10,7 +10,7 @@ Copyright (C) 2023 Faisal Salman <f+ua-parser-js@faisalman.com>
"We" are the team behind UAParser.js. "We" are the team behind UAParser.js.
"You" are the individual who is responsible for purchasing this license. "You" are the individual/organization/company who is responsible for purchasing this license.
"The Code" is UAParser.js. "The Code" is UAParser.js.
@@ -24,17 +24,17 @@ We retains all title, intellectual property, and ownership rights to The Code.
The Code is licensed, not sold, to You for use solely subject to the terms and conditions detailed here. The Code is licensed, not sold, to You for use solely subject to the terms and conditions detailed here.
We grant you (and only you) a personal, limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code. We grant You (and only You) a limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code.
This license is only valid for You as 1 (one) individual and can not be transferred to other individual or organization. This license is only valid for You as 1 (one) individual/organization/company and can not be transferred to other individual/organization/company.
--- ---
## Rights ## Rights
You may use and modify The Code to create as many personal, hobby, educational, and other non-profit use as you want for yourself. You may use and modify The Code only in 1 (one) Project, if you use it in more than 1 (one) Project you have to purchase for another license.
You may create any number of copies of The Code for yourself. If You transfer a Project to a client, the use of The Code must be limited to the original functionality that You created for them. The Code must not be extracted, reproduced, or used in any other way. You must inform your client of this condition.
You have the right to get lifetime updates and a 1 (one) year support, starting from the time you make the purchase. You have the right to get lifetime updates and a 1 (one) year support, starting from the time you make the purchase.
@@ -42,9 +42,7 @@ You have the right to get lifetime updates and a 1 (one) year support, starting
## Restriction ## Restriction
You may not use and modify The Code in such a way that may be used directly for commercial purpose. You may not redistribute The Code, as-is or modified, except as a part of a Project that you made.
You may not redistribute The Code, as-is or modified, except as a part of a Project that you made for yourself.
You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purpose to the general public, except with our written consent. You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purpose to the general public, except with our written consent.

View File

@@ -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

View File

@@ -4,12 +4,12 @@
# UAParser.js # UAParser.js
Thank you for purchasing UAParser.js PRO Personal License, if you haven't please oreder here: https://store.faisalman.com Thank you for purchasing UAParser.js PRO Business License, if you haven't please order here: https://store.faisalman.com
# Download # Download
```sh ```sh
npm install @ua-parser-js/pro-personal npm install @ua-parser-js/pro-business
``` ```
# Documentation # Documentation
@@ -18,6 +18,6 @@ https://docs.uaparser.js.org/v2
# License # License
UAParser.js PRO Personal UAParser.js PRO Business
Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>> Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

241
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@ua-parser-js/pro-personal", "name": "@ua-parser-js/pro-business",
"version": "2.0.0-beta.2", "version": "2.0.0-beta.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@ua-parser-js/pro-personal", "name": "@ua-parser-js/pro-business",
"version": "2.0.0-beta.2", "version": "2.0.0-beta.1",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@@ -21,10 +21,10 @@
"url": "https://github.com/sponsors/faisalman" "url": "https://github.com/sponsors/faisalman"
} }
], ],
"license": "UAParser.js-PRO-Personal", "license": "UAParser.js-PRO-Business",
"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", "@jazzer.js/core": "^1.4.0",
"@playwright/test": "~1.32.2", "@playwright/test": "~1.32.2",
"jshint": "~2.13.6", "jshint": "~2.13.6",
@@ -52,13 +52,12 @@
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
"version": "7.22.13", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/highlight": "^7.22.13", "@babel/highlight": "^7.18.6"
"chalk": "^2.4.2"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@@ -115,13 +114,34 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/@babel/generator": { "node_modules/@babel/core/node_modules/@babel/traverse": {
"version": "7.23.0", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.23.0", "@babel/code-frame": "^7.21.4",
"@babel/generator": "^7.21.4",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.21.0",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.21.4",
"@babel/types": "^7.21.4",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/generator": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz",
"integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.21.4",
"@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17", "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1" "jsesc": "^2.5.1"
@@ -150,34 +170,34 @@
} }
}, },
"node_modules/@babel/helper-environment-visitor": { "node_modules/@babel/helper-environment-visitor": {
"version": "7.22.20", "version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-function-name": { "node_modules/@babel/helper-function-name": {
"version": "7.23.0", "version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/template": "^7.22.15", "@babel/template": "^7.20.7",
"@babel/types": "^7.23.0" "@babel/types": "^7.21.0"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-hoist-variables": { "node_modules/@babel/helper-hoist-variables": {
"version": "7.22.5", "version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
"integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.22.5" "@babel/types": "^7.18.6"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@@ -214,6 +234,39 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-module-transforms/node_modules/@babel/parser": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
"integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@babel/helper-module-transforms/node_modules/@babel/traverse": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
"integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.21.4",
"@babel/generator": "^7.21.4",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.21.0",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.21.4",
"@babel/types": "^7.21.4",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-simple-access": { "node_modules/@babel/helper-simple-access": {
"version": "7.20.2", "version": "7.20.2",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz",
@@ -227,30 +280,30 @@
} }
}, },
"node_modules/@babel/helper-split-export-declaration": { "node_modules/@babel/helper-split-export-declaration": {
"version": "7.22.6", "version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.22.5" "@babel/types": "^7.18.6"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-string-parser": { "node_modules/@babel/helper-string-parser": {
"version": "7.22.5", "version": "7.19.4",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-validator-identifier": { "node_modules/@babel/helper-validator-identifier": {
"version": "7.22.20", "version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@@ -279,14 +332,47 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/highlight": { "node_modules/@babel/helpers/node_modules/@babel/parser": {
"version": "7.22.20", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@babel/helpers/node_modules/@babel/traverse": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
"integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-validator-identifier": "^7.22.20", "@babel/code-frame": "^7.21.4",
"chalk": "^2.4.2", "@babel/generator": "^7.21.4",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.21.0",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.21.4",
"@babel/types": "^7.21.4",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0" "js-tokens": "^4.0.0"
}, },
"engines": { "engines": {
@@ -306,23 +392,23 @@
} }
}, },
"node_modules/@babel/template": { "node_modules/@babel/template": {
"version": "7.22.15", "version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.22.13", "@babel/code-frame": "^7.18.6",
"@babel/parser": "^7.22.15", "@babel/parser": "^7.20.7",
"@babel/types": "^7.22.15" "@babel/types": "^7.20.7"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/template/node_modules/@babel/parser": { "node_modules/@babel/template/node_modules/@babel/parser": {
"version": "7.23.0", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
"dev": true, "dev": true,
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
@@ -332,19 +418,18 @@
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.23.2", "version": "7.15.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz",
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.22.13", "@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.23.0", "@babel/generator": "^7.15.4",
"@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.15.4",
"@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.15.4",
"@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.15.4",
"@babel/helper-split-export-declaration": "^7.22.6", "@babel/parser": "^7.15.4",
"@babel/parser": "^7.23.0", "@babel/types": "^7.15.4",
"@babel/types": "^7.23.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@@ -352,26 +437,14 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/traverse/node_modules/@babel/parser": {
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.23.0", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.22.5", "@babel/helper-string-parser": "^7.19.4",
"@babel/helper-validator-identifier": "^7.22.20", "@babel/helper-validator-identifier": "^7.19.1",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
}, },
"engines": { "engines": {
@@ -948,9 +1021,9 @@
"dev": true "dev": true
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.1", "version": "1.3.6",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.6.tgz",
"integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", "integrity": "sha512-PEcdkk7JcdPiMDkvM4K6ZBRYq9keuVJsToxm2zQIM70Qqo2WHTdJZMXcG9X+RmRp2VPNUQC8W1RAGbgt6b1yMg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",

View File

@@ -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: '2.0.0-beta.1',
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'

23
package.json Executable file → Normal file
View File

@@ -1,7 +1,7 @@
{ {
"title": "UAParser.js PRO Personal", "title": "UAParser.js PRO Business",
"name": "@ua-parser-js/pro-personal", "name": "@ua-parser-js/pro-business",
"version": "2.0.0-beta.2", "version": "2.0.0-beta.1",
"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 & Client Hints data. Supports browser & node.js environment",
"keywords": [ "keywords": [
@@ -174,8 +174,7 @@
"exports": { "exports": {
".": { ".": {
"require": "./src/main/ua-parser.js", "require": "./src/main/ua-parser.js",
"import": "./src/main/ua-parser.mjs", "import": "./src/main/ua-parser.mjs"
"types": "./src/main/ua-parser.d.ts"
}, },
"./enums": { "./enums": {
"require": "./src/enums/ua-parser-enums.js", "require": "./src/enums/ua-parser-enums.js",
@@ -183,13 +182,7 @@
}, },
"./extensions": { "./extensions": {
"require": "./src/extensions/ua-parser-extensions.js", "require": "./src/extensions/ua-parser-extensions.js",
"import": "./src/extensions/ua-parser-extensions.mjs", "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": [
@@ -201,7 +194,7 @@
"build+test": "npm run build && npm run test", "build+test": "npm run build && npm run test",
"fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync", "fuzz": "jazzer ./test/jazzer-fuzz-test.js --sync",
"test": "./script/test-all.sh", "test": "./script/test-all.sh",
"test:dts-lint": "tsd --typings src/main/ua-parser.d.ts --files test/dts-test.ts", "test:dts": "tsd --typings src/main/ua-parser.d.ts --files test/dts-test.ts",
"test:eslint": "eslint src && eslint script", "test:eslint": "eslint src && eslint script",
"test:jshint": "jshint src/main", "test:jshint": "jshint src/main",
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json", "test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
@@ -210,7 +203,7 @@
}, },
"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", "@jazzer.js/core": "^1.4.0",
"@playwright/test": "~1.32.2", "@playwright/test": "~1.32.2",
"jshint": "~2.13.6", "jshint": "~2.13.6",
@@ -224,7 +217,7 @@
"type": "git", "type": "git",
"url": "https://github.com/faisalman/ua-parser-js.git" "url": "https://github.com/faisalman/ua-parser-js.git"
}, },
"license": "UAParser.js-PRO-Personal", "license": "UAParser.js-PRO-Business",
"engines": { "engines": {
"node": "*" "node": "*"
}, },

View File

@@ -46,12 +46,6 @@ const modules = [
dest : 'src/extensions/ua-parser-extensions.mjs', dest : 'src/extensions/ua-parser-extensions.mjs',
title : 'ua-parser-js/extensions', title : 'ua-parser-js/extensions',
replacements : [] replacements : []
},
{
src : 'src/helpers/ua-parser-helpers.js',
dest : 'src/helpers/ua-parser-helpers.mjs',
title : 'ua-parser-js/helpers',
replacements : []
} }
]; ];

View File

@@ -29,4 +29,4 @@ npm run test:lockfile-lint || exit 1
echo ' echo '
- lint d.ts files - lint d.ts files
' '
npm run test:dts-lint || exit 1 npm run test:dts || exit 1

View File

@@ -1,144 +1,35 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.2 /* Enums for UAParser.js v2.0.0-beta.1
https://github.com/faisalman/ua-parser-js https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License */ UAParser.js PRO Business License */
////////////////////////////////////////////// //////////////////////////////////////////////
/*jshint esversion: 6 */ /*jshint esversion: 6 */
const Browser = Object.freeze({ const Browser = Object.freeze({
_2345_EXPLORER: '2345Explorer',
_360: '360 Browser',
ALIPAY: 'Alipay',
AMAYA: 'Amaya',
ANDROID: 'Android Browser', 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', BRAVE: 'Brave',
CAMINO: 'Camino',
CHIMERA: 'Chimera',
CHROME: 'Chrome', CHROME: 'Chrome',
CHROME_HEADLESS: 'Chrome Headless',
CHROME_MOBILE: 'Mobile Chrome',
CHROME_WEBVIEW: 'Chrome WebView',
CHROMIUM: 'Chromium', CHROMIUM: 'Chromium',
COBALT: 'Cobalt',
COC_COC: 'Coc Coc',
COMODO_DRAGON: 'Comodo Dragon',
CONKEROR: 'Conkeror',
DILLO: 'Dillo',
DOLPHIN: 'Dolphin', DOLPHIN: 'Dolphin',
DORIS: 'Doris',
DUCKDUCKGO: 'DuckDuckGo', DUCKDUCKGO: 'DuckDuckGo',
EDGE: 'Edge', EDGE: 'Edge',
EPIPHANY: 'Epiphany',
FACEBOOK: 'Facebook',
FALKON: 'Falkon',
FIREBIRD: 'Firebird',
FIREFOX: 'Firefox', FIREFOX: 'Firefox',
FIREFOX_FOCUS: 'Firefox Focus', FOCUS: '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', IE: 'IE',
INSTAGRAM: 'Instagram',
IRIDIUM: 'Iridium',
IRON: 'Iron',
JASMINE: 'Jasmine',
KONQUEROR: 'Konqueror', KONQUEROR: 'Konqueror',
KAKAO: 'KakaoTalk', MOBILE_CHROME: 'Mobile Chrome',
KHTML: 'KHTML', MOBILE_FIREFOX: 'Mobile Firefox',
K_MELEON: 'K-Meleon', MOBILE_SAFARI: 'Mobile Safari',
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: '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', PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
POLARIS: 'Polaris',
PUFFIN: 'Puffin', PUFFIN: 'Puffin',
QQ: 'QQ Browser', QQ: 'QQ Browser',
QQ_LITE: 'QQBrowserLite',
QUARK: 'Quark',
QUPZILLA: 'QupZilla',
REKONQ: 'rekonq',
ROCKMELT: 'Rockmelt',
SAFARI: 'Safari', SAFARI: 'Safari',
SAFARI_MOBILE: 'Mobile Safari',
SAILFISH: 'Sailfish Browser',
SAMSUNG: 'Samsung Internet', 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: 'UC Browser', UC: 'UC Browser',
UP: 'UP.Browser',
VIERA: 'Viera',
VIVALDI: 'Vivaldi', VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
WATERFOX: 'Waterfox',
WEBKIT: 'WebKit',
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
YANDEX: 'Yandex' YANDEX: 'Yandex'
// TODO : test! // TODO : test!
@@ -146,27 +37,25 @@ const Browser = Object.freeze({
const CPU = Object.freeze({ const CPU = Object.freeze({
ARM : 'arm', ARM : 'arm',
ARM_64: 'arm64', ARM64: 'arm64',
ARM_HF: 'armhf', ARMHF: 'armhf',
AVR: 'avr', AVR: 'avr',
AVR_32: 'avr32',
IA64: 'ia64', IA64: 'ia64',
IRIX: 'irix', IRIX: 'irix',
IRIX_64: 'irix64', IRIX64: 'irix64',
MIPS: 'mips', MIPS: 'mips',
MIPS_64: 'mips64', MIPS64: 'mips64',
M68K: '68k', MOTO_68K: '68k',
PA_RISC: 'pa-risc',
PPC: 'ppc', PPC: 'ppc',
SPARC: 'sparc', SPARC: 'sparc',
SPARC_64: 'sparc64', SPARC64: 'sparc64',
X86: 'ia32', X86: 'ia32',
X86_64: 'amd64' X86_64: 'amd64'
}); });
const Device = Object.freeze({ const Device = Object.freeze({
CONSOLE: 'console', CONSOLE: 'console',
DESKTOP: 'desktop', DEKSTOP: 'desktop',
EMBEDDED: 'embedded', EMBEDDED: 'embedded',
MOBILE: 'mobile', MOBILE: 'mobile',
SMARTTV: 'smarttv', SMARTTV: 'smarttv',
@@ -221,7 +110,6 @@ const Vendor = Object.freeze({
SIEMENS: 'Siemens', SIEMENS: 'Siemens',
SONY: 'Sony', SONY: 'Sony',
SPRINT: 'Sprint', SPRINT: 'Sprint',
TECHNISAT: 'TechniSAT',
TECNO: 'Tecno', TECNO: 'Tecno',
TESLA: 'Tesla', TESLA: 'Tesla',
ULEFONE: 'Ulefone', ULEFONE: 'Ulefone',
@@ -267,15 +155,14 @@ const OS = Object.freeze({
BLACKBERRY: 'BlackBerry', BLACKBERRY: 'BlackBerry',
CENTOS: 'CentOS', CENTOS: 'CentOS',
CHROME_OS: 'Chrome OS', CHROME_OS: 'Chrome OS',
CHROMECAST: 'Chromecast',
CONTIKI: 'Contiki', CONTIKI: 'Contiki',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
DEBIAN: 'Debian', DEBIAN: 'Debian',
DEEPIN: 'Deepin', DEEPIN: 'Deepin',
DRAGONFLY: 'DragonFly', DRAGONFLY: 'DragonFly',
ELEMENTARY_OS: 'elementary OS', ELEMENTARY_OS: 'elementary OS',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
FUCHSIA: 'Fuchsia', FUCHSIA: 'Fuchsia',
GENTOO: 'Gentoo', GENTOO: 'Gentoo',
GHOSTBSD: 'GhostBSD', GHOSTBSD: 'GhostBSD',
@@ -334,7 +221,6 @@ const OS = Object.freeze({
WINDOWS: 'Windows', WINDOWS: 'Windows',
WINDOWS_MOBILE: 'Windows Mobile', WINDOWS_MOBILE: 'Windows Mobile',
WINDOWS_PHONE: 'Windows Phone', WINDOWS_PHONE: 'Windows Phone',
XBOX: 'Xbox',
ZENWALK: 'Zenwalk' ZENWALK: 'Zenwalk'
// TODO : test! // TODO : test!

View File

@@ -3,146 +3,37 @@
// Source: /src/enums/ua-parser-enums.js // Source: /src/enums/ua-parser-enums.js
/////////////////////////////////////////////// ///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.2 /* Enums for UAParser.js v2.0.0-beta.1
https://github.com/faisalman/ua-parser-js https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License */ UAParser.js PRO Business License */
////////////////////////////////////////////// //////////////////////////////////////////////
/*jshint esversion: 6 */ /*jshint esversion: 6 */
const Browser = Object.freeze({ const Browser = Object.freeze({
_2345_EXPLORER: '2345Explorer',
_360: '360 Browser',
ALIPAY: 'Alipay',
AMAYA: 'Amaya',
ANDROID: 'Android Browser', 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', BRAVE: 'Brave',
CAMINO: 'Camino',
CHIMERA: 'Chimera',
CHROME: 'Chrome', CHROME: 'Chrome',
CHROME_HEADLESS: 'Chrome Headless',
CHROME_MOBILE: 'Mobile Chrome',
CHROME_WEBVIEW: 'Chrome WebView',
CHROMIUM: 'Chromium', CHROMIUM: 'Chromium',
COBALT: 'Cobalt',
COC_COC: 'Coc Coc',
COMODO_DRAGON: 'Comodo Dragon',
CONKEROR: 'Conkeror',
DILLO: 'Dillo',
DOLPHIN: 'Dolphin', DOLPHIN: 'Dolphin',
DORIS: 'Doris',
DUCKDUCKGO: 'DuckDuckGo', DUCKDUCKGO: 'DuckDuckGo',
EDGE: 'Edge', EDGE: 'Edge',
EPIPHANY: 'Epiphany',
FACEBOOK: 'Facebook',
FALKON: 'Falkon',
FIREBIRD: 'Firebird',
FIREFOX: 'Firefox', FIREFOX: 'Firefox',
FIREFOX_FOCUS: 'Firefox Focus', FOCUS: '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', IE: 'IE',
INSTAGRAM: 'Instagram',
IRIDIUM: 'Iridium',
IRON: 'Iron',
JASMINE: 'Jasmine',
KONQUEROR: 'Konqueror', KONQUEROR: 'Konqueror',
KAKAO: 'KakaoTalk', MOBILE_CHROME: 'Mobile Chrome',
KHTML: 'KHTML', MOBILE_FIREFOX: 'Mobile Firefox',
K_MELEON: 'K-Meleon', MOBILE_SAFARI: 'Mobile Safari',
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: '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', PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
POLARIS: 'Polaris',
PUFFIN: 'Puffin', PUFFIN: 'Puffin',
QQ: 'QQ Browser', QQ: 'QQ Browser',
QQ_LITE: 'QQBrowserLite',
QUARK: 'Quark',
QUPZILLA: 'QupZilla',
REKONQ: 'rekonq',
ROCKMELT: 'Rockmelt',
SAFARI: 'Safari', SAFARI: 'Safari',
SAFARI_MOBILE: 'Mobile Safari',
SAILFISH: 'Sailfish Browser',
SAMSUNG: 'Samsung Internet', 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: 'UC Browser', UC: 'UC Browser',
UP: 'UP.Browser',
VIERA: 'Viera',
VIVALDI: 'Vivaldi', VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
WATERFOX: 'Waterfox',
WEBKIT: 'WebKit',
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
YANDEX: 'Yandex' YANDEX: 'Yandex'
// TODO : test! // TODO : test!
@@ -150,27 +41,25 @@ const Browser = Object.freeze({
const CPU = Object.freeze({ const CPU = Object.freeze({
ARM : 'arm', ARM : 'arm',
ARM_64: 'arm64', ARM64: 'arm64',
ARM_HF: 'armhf', ARMHF: 'armhf',
AVR: 'avr', AVR: 'avr',
AVR_32: 'avr32',
IA64: 'ia64', IA64: 'ia64',
IRIX: 'irix', IRIX: 'irix',
IRIX_64: 'irix64', IRIX64: 'irix64',
MIPS: 'mips', MIPS: 'mips',
MIPS_64: 'mips64', MIPS64: 'mips64',
M68K: '68k', MOTO_68K: '68k',
PA_RISC: 'pa-risc',
PPC: 'ppc', PPC: 'ppc',
SPARC: 'sparc', SPARC: 'sparc',
SPARC_64: 'sparc64', SPARC64: 'sparc64',
X86: 'ia32', X86: 'ia32',
X86_64: 'amd64' X86_64: 'amd64'
}); });
const Device = Object.freeze({ const Device = Object.freeze({
CONSOLE: 'console', CONSOLE: 'console',
DESKTOP: 'desktop', DEKSTOP: 'desktop',
EMBEDDED: 'embedded', EMBEDDED: 'embedded',
MOBILE: 'mobile', MOBILE: 'mobile',
SMARTTV: 'smarttv', SMARTTV: 'smarttv',
@@ -225,7 +114,6 @@ const Vendor = Object.freeze({
SIEMENS: 'Siemens', SIEMENS: 'Siemens',
SONY: 'Sony', SONY: 'Sony',
SPRINT: 'Sprint', SPRINT: 'Sprint',
TECHNISAT: 'TechniSAT',
TECNO: 'Tecno', TECNO: 'Tecno',
TESLA: 'Tesla', TESLA: 'Tesla',
ULEFONE: 'Ulefone', ULEFONE: 'Ulefone',
@@ -271,15 +159,14 @@ const OS = Object.freeze({
BLACKBERRY: 'BlackBerry', BLACKBERRY: 'BlackBerry',
CENTOS: 'CentOS', CENTOS: 'CentOS',
CHROME_OS: 'Chrome OS', CHROME_OS: 'Chrome OS',
CHROMECAST: 'Chromecast',
CONTIKI: 'Contiki', CONTIKI: 'Contiki',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
DEBIAN: 'Debian', DEBIAN: 'Debian',
DEEPIN: 'Deepin', DEEPIN: 'Deepin',
DRAGONFLY: 'DragonFly', DRAGONFLY: 'DragonFly',
ELEMENTARY_OS: 'elementary OS', ELEMENTARY_OS: 'elementary OS',
FEDORA: 'Fedora',
FIREFOX_OS: 'Firefox OS',
FREEBSD: 'FreeBSD',
FUCHSIA: 'Fuchsia', FUCHSIA: 'Fuchsia',
GENTOO: 'Gentoo', GENTOO: 'Gentoo',
GHOSTBSD: 'GhostBSD', GHOSTBSD: 'GhostBSD',
@@ -338,7 +225,6 @@ const OS = Object.freeze({
WINDOWS: 'Windows', WINDOWS: 'Windows',
WINDOWS_MOBILE: 'Windows Mobile', WINDOWS_MOBILE: 'Windows Mobile',
WINDOWS_PHONE: 'Windows Phone', WINDOWS_PHONE: 'Windows Phone',
XBOX: 'Xbox',
ZENWALK: 'Zenwalk' ZENWALK: 'Zenwalk'
// TODO : test! // TODO : test!

View File

@@ -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;

View File

@@ -1,8 +1,8 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-beta.2 /* Extensions for UAParser.js v2.0.0-beta.1
https://github.com/faisalman/ua-parser-js https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License */ UAParser.js PRO Business License */
////////////////////////////////////////////// //////////////////////////////////////////////
/*jshint esversion: 6 */ /*jshint esversion: 6 */

View File

@@ -3,10 +3,10 @@
// Source: /src/extensions/ua-parser-extensions.js // Source: /src/extensions/ua-parser-extensions.js
/////////////////////////////////////////////// ///////////////////////////////////////////////
/* Extensions for UAParser.js v2.0.0-beta.2 /* Extensions for UAParser.js v2.0.0-beta.1
https://github.com/faisalman/ua-parser-js https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <f@faisalman.com> Author: Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License */ UAParser.js PRO Business License */
////////////////////////////////////////////// //////////////////////////////////////////////
/*jshint esversion: 6 */ /*jshint esversion: 6 */

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -1,4 +1,4 @@
// Type definitions for UAParser.js v2.0.0-beta.2 // Type definitions for UAParser.js v2.0.0-beta.1
// Project: https://github.com/faisalman/ua-parser-js // Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman> // Definitions by: Faisal Salman <https://github.com/faisalman>
@@ -47,12 +47,10 @@ declare namespace UAParser {
} }
type RegexMap = ((RegExp | string | (string | RegExp | Function)[])[])[]; 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, extensions?: Record<string, RegexMap>, headers?: Record<string, string>): IResult;
export function UAParser(uastring?: string, 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(extensions?: Record<string, RegexMap>, headers?: Record<string, string>): IResult;
export function UAParser(headers?: Record<string, string>): IResult; export function UAParser(headers?: Record<string, string>): IResult;
export class UAParser { export class UAParser {
@@ -86,9 +84,9 @@ declare namespace UAParser {
}; };
static readonly VERSION: string; static readonly VERSION: string;
constructor(uastring?: string, extensions?: UAParserExt, headers?: Record<string, string>); constructor(uastring?: string, extensions?: Record<string, RegexMap>, headers?: Record<string, string>);
constructor(uastring?: string, headers?: Record<string, string>); constructor(uastring?: string, headers?: Record<string, string>);
constructor(extensions?: UAParserExt, headers?: Record<string, string>); constructor(extensions?: Record<string, RegexMap>, headers?: Record<string, string>);
constructor(headers?: Record<string, string>); constructor(headers?: Record<string, string>);
getUA(): string; getUA(): string;

View File

@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v2.0.0-beta.2 /* UAParser.js v2.0.0-beta.1
Copyright © 2012-2023 Faisal Salman <f@faisalman.com> Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License *//* UAParser.js PRO Business License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Supports browser & node.js environment. Supports browser & node.js environment.
Demo : https://faisalman.github.io/ua-parser-js Demo : https://faisalman.github.io/ua-parser-js
@@ -19,7 +19,8 @@
// Constants // Constants
///////////// /////////////
var LIBVERSION = '2.0.0-beta.2',
var LIBVERSION = '2.0.0-beta.1',
EMPTY = '', EMPTY = '',
UNKNOWN = '?', UNKNOWN = '?',
FUNC_TYPE = 'function', FUNC_TYPE = 'function',
@@ -40,7 +41,7 @@
WEARABLE = 'wearable', WEARABLE = 'wearable',
EMBEDDED = 'embedded', EMBEDDED = 'embedded',
USER_AGENT = 'user-agent', USER_AGENT = 'user-agent',
UA_MAX_LENGTH = 500, UA_MAX_LENGTH = 350,
BRANDS = 'brands', BRANDS = 'brands',
FORMFACTOR = 'formFactor', FORMFACTOR = 'formFactor',
FULLVERLIST = 'fullVersionList', FULLVERLIST = 'fullVersionList',
@@ -69,7 +70,6 @@
BLACKBERRY = 'BlackBerry', BLACKBERRY = 'BlackBerry',
GOOGLE = 'Google', GOOGLE = 'Google',
HUAWEI = 'Huawei', HUAWEI = 'Huawei',
LENOVO = 'Lenovo',
LG = 'LG', LG = 'LG',
MICROSOFT = 'Microsoft', MICROSOFT = 'Microsoft',
MOTOROLA = 'Motorola', MOTOROLA = 'Motorola',
@@ -85,11 +85,9 @@
FIREFOX = 'Firefox', FIREFOX = 'Firefox',
OPERA = 'Opera', OPERA = 'Opera',
FACEBOOK = 'Facebook', FACEBOOK = 'Facebook',
SOGOU = 'Sogou',
WINDOWS = 'Windows'; WINDOWS = 'Windows';
var isWindow = typeof window !== UNDEF_TYPE, var NAVIGATOR = (typeof window !== UNDEF_TYPE && window.navigator) ?
NAVIGATOR = (isWindow && window.navigator) ?
window.navigator : window.navigator :
undefined, undefined,
NAVIGATOR_UADATA = (NAVIGATOR && NAVIGATOR.userAgentData) ? NAVIGATOR_UADATA = (NAVIGATOR && NAVIGATOR.userAgentData) ?
@@ -121,16 +119,13 @@
} }
return false; return false;
} }
return isString(str1) ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false; return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
}, },
isExtensions = function (obj) { isExtensions = function (obj) {
for (var prop in obj) { for (var prop in obj) {
return /^(browser|cpu|device|engine|os)$/.test(prop); return /^(browser|cpu|device|engine|os)$/.test(prop);
} }
}, },
isString = function (val) {
return typeof val === STR_TYPE;
},
itemListToArray = function (header) { itemListToArray = function (header) {
if (!header) return undefined; if (!header) return undefined;
var arr = []; var arr = [];
@@ -140,16 +135,16 @@
var token = trim(tokens[i]).split(';v='); var token = trim(tokens[i]).split(';v=');
arr[i] = { brand : token[0], version : token[1] }; arr[i] = { brand : token[0], version : token[1] };
} else { } else {
arr[i] = trim(tokens[i]); arr[i] = tokens[i];
} }
} }
return arr; return arr;
}, },
lowerize = function (str) { lowerize = function (str) {
return isString(str) ? str.toLowerCase() : str; return typeof(str) === STR_TYPE ? str.toLowerCase() : str;
}, },
majorize = function (version) { majorize = function (version) {
return isString(version) ? strip(/[^\d\.]/g, version).split('.')[0] : undefined; return typeof(version) === STR_TYPE ? strip(/[^\d\.]/g, version).split('.')[0] : undefined;
}, },
setProps = function (arr) { setProps = function (arr) {
for (var i in arr) { for (var i in arr) {
@@ -163,15 +158,15 @@
return this; return this;
}, },
strip = function (pattern, str) { strip = function (pattern, str) {
return isString(str) ? str.replace(pattern, EMPTY) : str; return str.replace(pattern, EMPTY);
}, },
stripQuotes = function (str) { stripQuotes = function (val) {
return strip(/\\?\"/g, str); return typeof val === STR_TYPE ? strip(/\\?\"/g, val) : val;
}, },
trim = function (str, len) { trim = function (str, len) {
if (isString(str)) { if (typeof(str) === STR_TYPE) {
str = strip(/^\s\s*/, str); str = strip(/^\s\s*/, str);
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
} }
}; };
@@ -300,18 +295,15 @@
], [NAME, VERSION], [ ], [NAME, VERSION], [
/opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0
], [VERSION, [NAME, OPERA+' Mini']], [ ], [VERSION, [NAME, OPERA+' Mini']], [
/\bop(?:rg)?x\/([\w\.]+)/i // Opera GX
], [VERSION, [NAME, OPERA+' GX']], [
/\bopr\/([\w\.]+)/i // Opera Webkit /\bopr\/([\w\.]+)/i // Opera Webkit
], [VERSION, [NAME, OPERA]], [ ], [VERSION, [NAME, OPERA]], [
// Mixed // Mixed
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu
], [VERSION, [NAME, 'Baidu']], [
/(kindle)\/([\w\.]+)/i, // Kindle /(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based // Trident based
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser
/(ba?idubrowser)[\/ ]?([\w\.]+)/i, // Baidu Browser
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
@@ -323,7 +315,8 @@
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
], [VERSION, [NAME, 'UCBrowser']], [ ], [VERSION, [NAME, 'UCBrowser']], [
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
/\bqbcore\/([\w\.]+).+microm/i, /\bqbcore\/([\w\.]+).+microm/i
], [VERSION, [NAME, 'WeChat(Win) Desktop']], [
/micromessenger\/([\w\.]+)/i // WeChat /micromessenger\/([\w\.]+)/i // WeChat
], [VERSION, [NAME, 'WeChat']], [ ], [VERSION, [NAME, 'WeChat']], [
/konqueror\/([\w\.]+)/i // Konqueror /konqueror\/([\w\.]+)/i // Konqueror
@@ -332,8 +325,6 @@
], [VERSION, [NAME, 'IE']], [ ], [VERSION, [NAME, 'IE']], [
/ya(?:search)?browser\/([\w\.]+)/i // Yandex /ya(?:search)?browser\/([\w\.]+)/i // Yandex
], [VERSION, [NAME, 'Yandex']], [ ], [VERSION, [NAME, 'Yandex']], [
/slbrowser\/([\w\.]+)/i // Smart Lenovo Browser
], [VERSION, [NAME, 'Smart ' + LENOVO + SUFFIX_BROWSER]], [
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
], [[NAME, /(.+)/, '$1 Secure' + SUFFIX_BROWSER], VERSION], [ ], [[NAME, /(.+)/, '$1 Secure' + SUFFIX_BROWSER], VERSION], [
/\bfocus\/([\w\.]+)/i // Firefox Focus /\bfocus\/([\w\.]+)/i // Firefox Focus
@@ -352,20 +343,15 @@
], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [ ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360 /\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [ ], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i /(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser
/samsungbrowser\/([\w\.]+)/i // Samsung Internet
], [VERSION, [NAME, SAMSUNG + ' Internet']], [
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [ ], [[NAME, /_/g, ' '], VERSION], [
/metasr[\/ ]?([\d\.]+)/i // Sogou Explorer
], [VERSION, [NAME, SOGOU + ' Explorer']], [
/(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile
], [[NAME, SOGOU + ' Mobile'], VERSION], [
/(electron)\/([\w\.]+) safari/i, // Electron-based App /(electron)\/([\w\.]+) safari/i, // Electron-based App
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser
], [NAME, VERSION], [ ], [NAME, VERSION], [
/(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser
/(lbbrowser)/i, // LieBao Browser /(lbbrowser)/i, // LieBao Browser
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android /\[(linkedin)app\]/i // LinkedIn App for iOS & Android
], [NAME], [ ], [NAME], [
@@ -373,12 +359,10 @@
// WebView // WebView
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android
], [[NAME, FACEBOOK], VERSION], [ ], [[NAME, FACEBOOK], VERSION], [
/(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android
/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp
/safari (line)\/([\w\.]+)/i, // Line App for iOS /safari (line)\/([\w\.]+)/i, // Line App for iOS
/\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android
/(alipay)client\/([\w\.]+)/i, // Alipay
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat
], [NAME, VERSION], [ ], [NAME, VERSION], [
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
@@ -510,7 +494,7 @@
/\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi
/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|\))/i, // Xiaomi Redmi 'numeric' models
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi
], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad
@@ -550,7 +534,7 @@
// Lenovo // Lenovo
/(ideatab[-\w ]+)/i, /(ideatab[-\w ]+)/i,
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
], [MODEL, [VENDOR, LENOVO], [TYPE, TABLET]], [ ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
// Nokia // Nokia
/(?:maemo|nokia).*(n900|lumia \d+)/i, /(?:maemo|nokia).*(n900|lumia \d+)/i,
@@ -724,7 +708,7 @@
// MIXED (GENERIC) // MIXED (GENERIC)
/////////////////// ///////////////////
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors
], [MODEL, [TYPE, MOBILE]], [ ], [MODEL, [TYPE, MOBILE]], [
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors
], [MODEL, [TYPE, TABLET]], [ ], [MODEL, [TYPE, TABLET]], [
@@ -761,12 +745,12 @@
// Windows // Windows
/microsoft (windows) (vista|xp)/i // Windows (iTunes) /microsoft (windows) (vista|xp)/i // Windows (iTunes)
], [NAME, VERSION], [ ], [NAME, VERSION], [
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i // Windows Phone /(windows) nt 6\.2; (arm)/i, // Windows RT
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone
/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i
], [NAME, [VERSION, strMapper, windowsVersionMap]], [ ], [NAME, [VERSION, strMapper, windowsVersionMap]], [
/windows nt 6\.2; (arm)/i, // Windows RT /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, ], [[NAME, WINDOWS], [VERSION, strMapper, windowsVersionMap]], [
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
], [[VERSION, strMapper, windowsVersionMap], [NAME, WINDOWS]], [
// iOS/macOS // iOS/macOS
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
@@ -1055,16 +1039,15 @@
switch (this.itemType) { switch (this.itemType) {
case UA_BROWSER: case UA_BROWSER:
var brands = uaCH[FULLVERLIST] || uaCH[BRANDS], prevName; var brands = uaCH[FULLVERLIST] || uaCH[BRANDS];
if (brands) { if (brands) {
for (var i in brands) { for (var i in brands) {
var brandName = strip(/(Google|Microsoft) /, brands[i].brand || brands[i]), var brandName = brands[i].brand,
brandVersion = brands[i].version; brandVersion = brands[i].version;
if (!/not.a.brand/i.test(brandName) && (!prevName || (/chrom/i.test(prevName) && !/chromi/i.test(brandName)))) { if (!/not.a.brand/i.test(brandName) && (i < 1 || /chromi/i.test(this.get(NAME)))) {
this.set(NAME, brandName) this.set(NAME, strip(GOOGLE+' ', brandName))
.set(VERSION, brandVersion) .set(VERSION, brandVersion)
.set(MAJOR, majorize(brandVersion)); .set(MAJOR, majorize(brandVersion));
prevName = brandName;
} }
} }
} }
@@ -1083,11 +1066,6 @@
if (uaCH[MODEL]) { if (uaCH[MODEL]) {
this.set(MODEL, uaCH[MODEL]); this.set(MODEL, uaCH[MODEL]);
} }
// Xbox-Specific Detection
if (uaCH[MODEL] == 'Xbox') {
this.set(TYPE, CONSOLE)
.set(VENDOR, MICROSOFT);
}
if (uaCH[FORMFACTOR]) { if (uaCH[FORMFACTOR]) {
var ff; var ff;
if (typeof uaCH[FORMFACTOR] !== 'string') { if (typeof uaCH[FORMFACTOR] !== 'string') {
@@ -1109,11 +1087,6 @@
this.set(NAME, osName) this.set(NAME, osName)
.set(VERSION, osVersion); .set(VERSION, osVersion);
} }
// Xbox-Specific Detection
if (this.get(NAME) == WINDOWS && uaCH[MODEL] == 'Xbox') {
this.set(NAME, 'Xbox')
.set(VERSION, undefined);
}
break; break;
case UA_RESULT: case UA_RESULT:
var data = this.data; var data = this.data;
@@ -1207,7 +1180,7 @@
['getResult', createItemFunc(UA_RESULT)], ['getResult', createItemFunc(UA_RESULT)],
['getUA', function () { return userAgent; }], ['getUA', function () { return userAgent; }],
['setUA', function (ua) { ['setUA', function (ua) {
if (isString(ua)) if (typeof ua === STR_TYPE)
userAgent = ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua; userAgent = ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua;
return this; return this;
}] }]
@@ -1228,7 +1201,7 @@
////////// //////////
// check js environment // check js environment
if (typeof exports !== UNDEF_TYPE) { if (typeof(exports) !== UNDEF_TYPE) {
// nodejs env // nodejs env
if (typeof module !== UNDEF_TYPE && module.exports) { if (typeof module !== UNDEF_TYPE && module.exports) {
exports = module.exports = UAParser; exports = module.exports = UAParser;
@@ -1236,11 +1209,11 @@
exports.UAParser = UAParser; exports.UAParser = UAParser;
} else { } else {
// requirejs env (optional) // requirejs env (optional)
if (typeof define === FUNC_TYPE && define.amd) { if (typeof(define) === FUNC_TYPE && define.amd) {
define(function () { define(function () {
return UAParser; return UAParser;
}); });
} else if (isWindow) { } else if (typeof window !== UNDEF_TYPE) {
// browser env // browser env
window.UAParser = UAParser; window.UAParser = UAParser;
} }
@@ -1251,7 +1224,7 @@
// In AMD env the global scope should be kept clean, but jQuery is an exception. // In AMD env the global scope should be kept clean, but jQuery is an exception.
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used, // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
// and we should catch that. // and we should catch that.
var $ = isWindow && (window.jQuery || window.Zepto); var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);
if ($ && !$.ua) { if ($ && !$.ua) {
var parser = new UAParser(); var parser = new UAParser();
$.ua = parser.getResult(); $.ua = parser.getResult();

View File

@@ -3,9 +3,9 @@
// Source: /src/main/ua-parser.js // Source: /src/main/ua-parser.js
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v2.0.0-beta.2 /* UAParser.js v2.0.0-beta.1
Copyright © 2012-2023 Faisal Salman <f@faisalman.com> Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
UAParser.js PRO Personal License *//* UAParser.js PRO Business License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Supports browser & node.js environment. Supports browser & node.js environment.
Demo : https://faisalman.github.io/ua-parser-js Demo : https://faisalman.github.io/ua-parser-js
@@ -21,7 +21,8 @@
// Constants // Constants
///////////// /////////////
var LIBVERSION = '2.0.0-beta.2',
var LIBVERSION = '2.0.0-beta.1',
EMPTY = '', EMPTY = '',
UNKNOWN = '?', UNKNOWN = '?',
FUNC_TYPE = 'function', FUNC_TYPE = 'function',
@@ -42,7 +43,7 @@
WEARABLE = 'wearable', WEARABLE = 'wearable',
EMBEDDED = 'embedded', EMBEDDED = 'embedded',
USER_AGENT = 'user-agent', USER_AGENT = 'user-agent',
UA_MAX_LENGTH = 500, UA_MAX_LENGTH = 350,
BRANDS = 'brands', BRANDS = 'brands',
FORMFACTOR = 'formFactor', FORMFACTOR = 'formFactor',
FULLVERLIST = 'fullVersionList', FULLVERLIST = 'fullVersionList',
@@ -71,7 +72,6 @@
BLACKBERRY = 'BlackBerry', BLACKBERRY = 'BlackBerry',
GOOGLE = 'Google', GOOGLE = 'Google',
HUAWEI = 'Huawei', HUAWEI = 'Huawei',
LENOVO = 'Lenovo',
LG = 'LG', LG = 'LG',
MICROSOFT = 'Microsoft', MICROSOFT = 'Microsoft',
MOTOROLA = 'Motorola', MOTOROLA = 'Motorola',
@@ -87,11 +87,9 @@
FIREFOX = 'Firefox', FIREFOX = 'Firefox',
OPERA = 'Opera', OPERA = 'Opera',
FACEBOOK = 'Facebook', FACEBOOK = 'Facebook',
SOGOU = 'Sogou',
WINDOWS = 'Windows'; WINDOWS = 'Windows';
var isWindow = typeof window !== UNDEF_TYPE, var NAVIGATOR = (typeof window !== UNDEF_TYPE && window.navigator) ?
NAVIGATOR = (isWindow && window.navigator) ?
window.navigator : window.navigator :
undefined, undefined,
NAVIGATOR_UADATA = (NAVIGATOR && NAVIGATOR.userAgentData) ? NAVIGATOR_UADATA = (NAVIGATOR && NAVIGATOR.userAgentData) ?
@@ -123,16 +121,13 @@
} }
return false; return false;
} }
return isString(str1) ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false; return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
}, },
isExtensions = function (obj) { isExtensions = function (obj) {
for (var prop in obj) { for (var prop in obj) {
return /^(browser|cpu|device|engine|os)$/.test(prop); return /^(browser|cpu|device|engine|os)$/.test(prop);
} }
}, },
isString = function (val) {
return typeof val === STR_TYPE;
},
itemListToArray = function (header) { itemListToArray = function (header) {
if (!header) return undefined; if (!header) return undefined;
var arr = []; var arr = [];
@@ -142,16 +137,16 @@
var token = trim(tokens[i]).split(';v='); var token = trim(tokens[i]).split(';v=');
arr[i] = { brand : token[0], version : token[1] }; arr[i] = { brand : token[0], version : token[1] };
} else { } else {
arr[i] = trim(tokens[i]); arr[i] = tokens[i];
} }
} }
return arr; return arr;
}, },
lowerize = function (str) { lowerize = function (str) {
return isString(str) ? str.toLowerCase() : str; return typeof(str) === STR_TYPE ? str.toLowerCase() : str;
}, },
majorize = function (version) { majorize = function (version) {
return isString(version) ? strip(/[^\d\.]/g, version).split('.')[0] : undefined; return typeof(version) === STR_TYPE ? strip(/[^\d\.]/g, version).split('.')[0] : undefined;
}, },
setProps = function (arr) { setProps = function (arr) {
for (var i in arr) { for (var i in arr) {
@@ -165,15 +160,15 @@
return this; return this;
}, },
strip = function (pattern, str) { strip = function (pattern, str) {
return isString(str) ? str.replace(pattern, EMPTY) : str; return str.replace(pattern, EMPTY);
}, },
stripQuotes = function (str) { stripQuotes = function (val) {
return strip(/\\?\"/g, str); return typeof val === STR_TYPE ? strip(/\\?\"/g, val) : val;
}, },
trim = function (str, len) { trim = function (str, len) {
if (isString(str)) { if (typeof(str) === STR_TYPE) {
str = strip(/^\s\s*/, str); str = strip(/^\s\s*/, str);
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
} }
}; };
@@ -302,18 +297,15 @@
], [NAME, VERSION], [ ], [NAME, VERSION], [
/opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0
], [VERSION, [NAME, OPERA+' Mini']], [ ], [VERSION, [NAME, OPERA+' Mini']], [
/\bop(?:rg)?x\/([\w\.]+)/i // Opera GX
], [VERSION, [NAME, OPERA+' GX']], [
/\bopr\/([\w\.]+)/i // Opera Webkit /\bopr\/([\w\.]+)/i // Opera Webkit
], [VERSION, [NAME, OPERA]], [ ], [VERSION, [NAME, OPERA]], [
// Mixed // Mixed
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu
], [VERSION, [NAME, 'Baidu']], [
/(kindle)\/([\w\.]+)/i, // Kindle /(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based // Trident based
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser
/(ba?idubrowser)[\/ ]?([\w\.]+)/i, // Baidu Browser
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
@@ -325,7 +317,8 @@
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
], [VERSION, [NAME, 'UCBrowser']], [ ], [VERSION, [NAME, 'UCBrowser']], [
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
/\bqbcore\/([\w\.]+).+microm/i, /\bqbcore\/([\w\.]+).+microm/i
], [VERSION, [NAME, 'WeChat(Win) Desktop']], [
/micromessenger\/([\w\.]+)/i // WeChat /micromessenger\/([\w\.]+)/i // WeChat
], [VERSION, [NAME, 'WeChat']], [ ], [VERSION, [NAME, 'WeChat']], [
/konqueror\/([\w\.]+)/i // Konqueror /konqueror\/([\w\.]+)/i // Konqueror
@@ -334,8 +327,6 @@
], [VERSION, [NAME, 'IE']], [ ], [VERSION, [NAME, 'IE']], [
/ya(?:search)?browser\/([\w\.]+)/i // Yandex /ya(?:search)?browser\/([\w\.]+)/i // Yandex
], [VERSION, [NAME, 'Yandex']], [ ], [VERSION, [NAME, 'Yandex']], [
/slbrowser\/([\w\.]+)/i // Smart Lenovo Browser
], [VERSION, [NAME, 'Smart ' + LENOVO + SUFFIX_BROWSER]], [
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
], [[NAME, /(.+)/, '$1 Secure' + SUFFIX_BROWSER], VERSION], [ ], [[NAME, /(.+)/, '$1 Secure' + SUFFIX_BROWSER], VERSION], [
/\bfocus\/([\w\.]+)/i // Firefox Focus /\bfocus\/([\w\.]+)/i // Firefox Focus
@@ -354,20 +345,15 @@
], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [ ], [VERSION, [NAME, PREFIX_MOBILE + FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360 /\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [ ], [[NAME, '360' + SUFFIX_BROWSER]], [
/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i /(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser
/samsungbrowser\/([\w\.]+)/i // Samsung Internet
], [VERSION, [NAME, SAMSUNG + ' Internet']], [
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [ ], [[NAME, /_/g, ' '], VERSION], [
/metasr[\/ ]?([\d\.]+)/i // Sogou Explorer
], [VERSION, [NAME, SOGOU + ' Explorer']], [
/(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile
], [[NAME, SOGOU + ' Mobile'], VERSION], [
/(electron)\/([\w\.]+) safari/i, // Electron-based App /(electron)\/([\w\.]+) safari/i, // Electron-based App
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser
], [NAME, VERSION], [ ], [NAME, VERSION], [
/(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser
/(lbbrowser)/i, // LieBao Browser /(lbbrowser)/i, // LieBao Browser
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android /\[(linkedin)app\]/i // LinkedIn App for iOS & Android
], [NAME], [ ], [NAME], [
@@ -375,12 +361,10 @@
// WebView // WebView
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android
], [[NAME, FACEBOOK], VERSION], [ ], [[NAME, FACEBOOK], VERSION], [
/(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android
/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp
/safari (line)\/([\w\.]+)/i, // Line App for iOS /safari (line)\/([\w\.]+)/i, // Line App for iOS
/\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android
/(alipay)client\/([\w\.]+)/i, // Alipay
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat
], [NAME, VERSION], [ ], [NAME, VERSION], [
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
@@ -512,7 +496,7 @@
/\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi
/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|\))/i, // Xiaomi Redmi 'numeric' models
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi
], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad
@@ -552,7 +536,7 @@
// Lenovo // Lenovo
/(ideatab[-\w ]+)/i, /(ideatab[-\w ]+)/i,
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
], [MODEL, [VENDOR, LENOVO], [TYPE, TABLET]], [ ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
// Nokia // Nokia
/(?:maemo|nokia).*(n900|lumia \d+)/i, /(?:maemo|nokia).*(n900|lumia \d+)/i,
@@ -726,7 +710,7 @@
// MIXED (GENERIC) // MIXED (GENERIC)
/////////////////// ///////////////////
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors
], [MODEL, [TYPE, MOBILE]], [ ], [MODEL, [TYPE, MOBILE]], [
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors
], [MODEL, [TYPE, TABLET]], [ ], [MODEL, [TYPE, TABLET]], [
@@ -763,12 +747,12 @@
// Windows // Windows
/microsoft (windows) (vista|xp)/i // Windows (iTunes) /microsoft (windows) (vista|xp)/i // Windows (iTunes)
], [NAME, VERSION], [ ], [NAME, VERSION], [
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i // Windows Phone /(windows) nt 6\.2; (arm)/i, // Windows RT
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone
/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i
], [NAME, [VERSION, strMapper, windowsVersionMap]], [ ], [NAME, [VERSION, strMapper, windowsVersionMap]], [
/windows nt 6\.2; (arm)/i, // Windows RT /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, ], [[NAME, WINDOWS], [VERSION, strMapper, windowsVersionMap]], [
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
], [[VERSION, strMapper, windowsVersionMap], [NAME, WINDOWS]], [
// iOS/macOS // iOS/macOS
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
@@ -1057,16 +1041,15 @@
switch (this.itemType) { switch (this.itemType) {
case UA_BROWSER: case UA_BROWSER:
var brands = uaCH[FULLVERLIST] || uaCH[BRANDS], prevName; var brands = uaCH[FULLVERLIST] || uaCH[BRANDS];
if (brands) { if (brands) {
for (var i in brands) { for (var i in brands) {
var brandName = strip(/(Google|Microsoft) /, brands[i].brand || brands[i]), var brandName = brands[i].brand,
brandVersion = brands[i].version; brandVersion = brands[i].version;
if (!/not.a.brand/i.test(brandName) && (!prevName || (/chrom/i.test(prevName) && !/chromi/i.test(brandName)))) { if (!/not.a.brand/i.test(brandName) && (i < 1 || /chromi/i.test(this.get(NAME)))) {
this.set(NAME, brandName) this.set(NAME, strip(GOOGLE+' ', brandName))
.set(VERSION, brandVersion) .set(VERSION, brandVersion)
.set(MAJOR, majorize(brandVersion)); .set(MAJOR, majorize(brandVersion));
prevName = brandName;
} }
} }
} }
@@ -1085,11 +1068,6 @@
if (uaCH[MODEL]) { if (uaCH[MODEL]) {
this.set(MODEL, uaCH[MODEL]); this.set(MODEL, uaCH[MODEL]);
} }
// Xbox-Specific Detection
if (uaCH[MODEL] == 'Xbox') {
this.set(TYPE, CONSOLE)
.set(VENDOR, MICROSOFT);
}
if (uaCH[FORMFACTOR]) { if (uaCH[FORMFACTOR]) {
var ff; var ff;
if (typeof uaCH[FORMFACTOR] !== 'string') { if (typeof uaCH[FORMFACTOR] !== 'string') {
@@ -1111,11 +1089,6 @@
this.set(NAME, osName) this.set(NAME, osName)
.set(VERSION, osVersion); .set(VERSION, osVersion);
} }
// Xbox-Specific Detection
if (this.get(NAME) == WINDOWS && uaCH[MODEL] == 'Xbox') {
this.set(NAME, 'Xbox')
.set(VERSION, undefined);
}
break; break;
case UA_RESULT: case UA_RESULT:
var data = this.data; var data = this.data;
@@ -1209,7 +1182,7 @@
['getResult', createItemFunc(UA_RESULT)], ['getResult', createItemFunc(UA_RESULT)],
['getUA', function () { return userAgent; }], ['getUA', function () { return userAgent; }],
['setUA', function (ua) { ['setUA', function (ua) {
if (isString(ua)) if (typeof ua === STR_TYPE)
userAgent = ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua; userAgent = ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua;
return this; return this;
}] }]

View File

@@ -1,6 +1,5 @@
import { expectType } from 'tsd'; import { expectType } from 'tsd';
import { UAParser, IResult, IBrowser, ICPU, IEngine, IDevice, IOS } from "../src/main/ua-parser"; 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 uastring = 'Mozilla/5.0 (X11; MyCustomOS; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0';
const extensions = { const extensions = {
@@ -41,8 +40,3 @@ expectType<IOS>(parser.getOS());
expectType<IResult>(parser.getResult()); expectType<IResult>(parser.getResult());
expectType<string>(parser.getUA()); expectType<string>(parser.getUA());
expectType<UAParser>(parser.setUA(uastring)); expectType<UAParser>(parser.setUA(uastring));
const result = parser.getResult();
expectType<boolean>(isAppleSilicon(result));
expectType<boolean>(isChromiumBased(result));

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,4 @@
// @ts-check
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import path from 'path'; import path from 'path';
import url from 'url'; import url from 'url';

View File

@@ -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"
} }
@@ -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",
@@ -509,26 +429,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",
@@ -808,26 +708,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",
@@ -1138,26 +1018,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",
@@ -1269,55 +1129,15 @@
} }
}, },
{ {
"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",
@@ -1528,16 +1348,6 @@
"major" : "2" "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", "desc" : "Viera",
"ua" : "HbbTV/1.2.1 (;Panasonic;VIERA 2015;3.014;a001-003 4000-0000;)", "ua" : "HbbTV/1.2.1 (;Panasonic;VIERA 2015;3.014;a001-003 4000-0000;)",
@@ -1768,12 +1578,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 +1613,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 +1643,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 +1654,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",

View File

@@ -2843,15 +2843,6 @@
"type": "mobile" "type": "mobile"
} }
}, },
{
"desc": "XiaoMi Redmi Note 12 Turbo",
"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": {
"vendor": "Xiaomi",
"model": "23049RAD8C",
"type": "mobile"
}
},
{ {
"desc": "ZTE Blade A6", "desc": "ZTE Blade A6",
"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", "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",

View File

@@ -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)",