Skip to content

Commit

Permalink
Upgrade ua-parser-js to v0.7.33 (#4)
Browse files Browse the repository at this point in the history
* FIX: Wechat Desktop for Windows compatible with new version

* Move to check typeof for window for different envs

* Fix faisalman#413 Bug resulting Motorola model O

* Fix faisalman#367 faisalman#425 Detect Instagram in-app browser

* Add funding support links

* Fix faisalman#450 Sony Xperia Z2 Tablet

* Fix faisalman#454 Improve Samsung detection

* Add Nintendo Switch

* Fix faisalman#366 Amazon Alexa Echo Show

* Fix faisalman#339 Add Weibo

* Fix faisalman#407 ZTE Nubia misidentified as Nextbook Tablet

* FIX: new wechat desktop's unsafe regex

* Fix faisalman#433 faisalman#434 Huawei devices

* Fix faisalman#475 Nokia version incomplete

* Fix faisalman#470 Identify Android TV as SmartTV

* Latest Xperia lineup

* Fix faisalman#430 Playstation 5

* Fix faisalman#449 Lenovo Tablet

* Casually save some bytes

* Fix faisalman#401 Rearrange the order of regexes to improve hit-rate performance

* Fix faisalman#427 - Trying GitHub Actions

* Change mocha reporter for CI

* Action doesn't work, should be under /.github/workflows folder perhaps

* Fix faisalman#438 Add Zebra devices

* Update README contents & structures

* Enforce maximum limit to user-agent input

* Move documentation upwards and..mAkE tHe LoG0 BiG99eR!!1!1!

* Add CDN links & insert npm fund

* Fix faisalman#422 Add ARMHF in CPU Arch detection

* Fix faisalman#279 Remap old Edge versions <= 44 as suggested by @mikemaccana @callaginn

* Fix faisalman#448 Add AT&T & Vodafone devices

* Fix faisalman#209 Add CHANGELOG

* Add Electron

* Simplify Huawei detection

* Release as 0.7.25

* Refine some OS detection

* Add new OS: Raspbian

* Add Device: Surface Duo

* Add some test cases for Samsung, Huawei, Xiaomi

* Detect ARMEABI as ARM

* Casually save some bytes

* Refine some detection with more test cases

* Add new device.vendor: Vivo

* Fix faisalman#342 - Enforce all regexes to comply with safe-regex as a safeguard against possible ReDoS vulnerability

* Fix regexes that were marked as unsafe by safe-regex module

* Refine device detection with more test cases

* Add new device.vendor: Realme

* Release as 0.7.26

* Better tablet detection:
- Huawei MediaPad M/T
- Galaxy Tab SM-P
- Kindle Fire without Silk

* Better tablet detection:
- Fix lenovo phone / tablet detection

* Better tablet detection - Build.

* Better tablet detection:
- iPad using Facebook browser on some occasions
- More Huawei tablets
- Asus ZenPad Z8s (P00J)

* Small refactor

* Add new Engine & Browser: Flow

* Add new browser: Firefox Reality

* Add new device: Fairphone

* Add string check to setUA method

* Release as 0.7.27

* More test for latest phones with unique form factor (fold/flip/qwerty/swivel)

* Add new device & browser: Tesla

* Minor rearrangement

* More test for tablet devices

* Update contributor list

* Fix faisalman#492 LG TV WebOS detection

* Delete redundant code

* Refactor code: saving bytes towards 15KB minified

* Update readme: use https for demo link

* Test for Firefox UAs, add new browser: Klar, add new OS: Maemo

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox

* Revert breaking fix faisalman#279 and release as 0.7.28

* Improve detection rule for Mac on PowerPC

* Improve device detection: categorize PDA as mobile

* Improve browser detection: Netscape with version

* Improve os detection: Windows Mobile without version

* Add new OS: HP-UX

* Add new browsers: Obigo, UP.Browser

* Add new device vendor: Roku

Source: https://github.com/WhichBrowser/Parser-PHP/blob/master/tests/data/television/roku.yaml

* Refine some OS detection

Source:
- https://www.zytrax.com/tech/web/browser_ids.htm
- https://developers.whatismybrowser.com/useragents/explore/operating_system_name/

* Remove oldEdge map

* Replace `\s` with space, saving ~0,3KB

* ES3 compat-fix: remove trailing comma

* Improve device detection: Huawei, Xiaomi, Realme, LG, OnePlus, ASUS, ZTE, Fairphone

* Improve CPU detection for ARM64

* Improve device detection: LG Android TV

* Add new OS: Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon

User-Agent source: whatismybrowser.com

* Fix faisalman#500 Sharp devices misjudged as Huawei devices

* Fix faisalman#506 - add test for Huawei ART-L29

* Fix faisalman#509 add support for Internet Explorer 8

* Create SECURITY.md

A simple instruction for security researchers.

* Improve regex efficiency when trimming long ua string

https://blog.stevenlevithan.com/archives/faster-trim-javascript

* Add Huawei models

* Sony Xperia 1ii

* Samsung Galaxy S20 5G

* Add different oculus browser

* Oculus devices

* cleanup

* cleanup

* change to single line regex

* Enable to detect OPPO Reno5 A correctly.

* Securing the 0.7.x version (issue faisalman#536)

* Securing the 0.8.x version (issue faisalman#536)

* Securing the 1.x version (issue faisalman#536)

* feat: require the use of `===` and `!==`

* Update ua-parser.js

* ✨ Use AST to verify whether regexes are safe

* Bump version 0.7.31

* Fix faisalman#559: Sony Xperia 1 III misidentified as Acer tablet

* Fix faisalman#533: Detect Sony BRAVIA as SmartTV

* Fix faisalman#562 - Xiaomi Mi CC9

* Fix faisalman#561 - Increase UA_MAX_LENGTH to 275

* pr feedback

* v100 tests

* Add support for HuaweiBrowser

* update readme

* package.json: specify the folders to include

* add KakaoTalk App, KakaoStory App regex

* Add Kakao App, Naver App

* Add iOS Naver, Kakao regex

* fix browser-test typo

* Add LinkedIn app.

* Rename 'HuaweiBrowser' to 'Huawei Browser'

* Fix faisalman#565 - Add new OS: HarmonyOS

* Fix faisalman#558 - WeGame mistakenly identified as WeChat

* Increase UA_MAX_LENGTH to 350

* Fix faisalman#532 - Detect Xiaomi Mi TV as smarttv

* Fix faisalman#513 - Add new browser: DuckDuckGo

* Fix faisalman#516 - Add Focus into list of possible browser.name

* ci: add GitHub token permissions for workflow

Signed-off-by: Varun Sharma <[email protected]>

* fixed sony bravia smart tv, added sharp AQUOS TV

* Safari and Mobile Safari began to include commas in the minor version numbers.

* Fix faisalman#502 faisalman#580 : Add notice for desktop device type

* Refine small redundancy

* Fix faisalman#596 - Detect Galaxy Tab S8 as tablet

* Add test case

* improved documentation

* Bump version 0.7.32

* Add new browser: Cobalt

* Fix documentation

`readme.md` refers to a `parser.getResults` function, which does not exist. This PR corrects the function name to `getResult`.

* Support Panasonic Viera Smart TVs

* Support Panasonic 2018+ smart tvs

* Add test for panasonic 2020 smart tv

* Add test for panasonic SAT receiver

* Support Loewe Smart TVs

* Add tests for JVC smart tvs

* Support philips smart tvs

* Add samsung testcases

* Add support for TechniSAT TVs and SATs

* Fix faisalman#605 - Identify Macintosh as Apple device

* Remove unsafe regex in trim() function

`trim()` function contains a regular expression that is vulnerable to ReDoS but was uncaught by `safe-regex` module.

* Bump version 0.7.33

* Fix faisalman#557 faisalman#612 faisalman#629 - Update the changelog

* Fix faisalman#621 - Detect Oculus Quest Pro

* Utilize navigator.userAgentData as a fallback faisalman#588

* Improve Kakao/Naver detection + add test

* Fix faisalman#619 - Move Sharp up to be checked before Huawei

* Rearrange the recently added smarttv detection

* Fix faisalman#620 - Add new Device: Kobo

* Fix faisalman#601 - Detect Chrome OS without version

* Update manifest

* fix: Don't act as a jQuery plugin

* build: 0.7.24 custom version

* Rebuilt min versions

---------

Signed-off-by: Varun Sharma <[email protected]>
Co-authored-by: ruicong <[email protected]>
Co-authored-by: David Annez <[email protected]>
Co-authored-by: Faisal Salman <[email protected]>
Co-authored-by: sUP <[email protected]>
Co-authored-by: o.drapeza <[email protected]>
Co-authored-by: liujunlve <[email protected]>
Co-authored-by: Ziding Zhang <[email protected]>
Co-authored-by: Paris Morgan <[email protected]>
Co-authored-by: Ryohei Shima <[email protected]>
Co-authored-by: chenhui9279 <[email protected]>
Co-authored-by: sunny-mwx <[email protected]>
Co-authored-by: Hans Ott <[email protected]>
Co-authored-by: XhmikosR <[email protected]>
Co-authored-by: KnifeLemon <[email protected]>
Co-authored-by: Dante <[email protected]>
Co-authored-by: JBYoshi <[email protected]>
Co-authored-by: Varun Sharma <[email protected]>
Co-authored-by: Jacky Choo <[email protected]>
Co-authored-by: nabetama <[email protected]>
Co-authored-by: kNoAPP <[email protected]>
Co-authored-by: Mok <[email protected]>
Co-authored-by: Oscar Becerra <[email protected]>
Co-authored-by: Riley Shaw <[email protected]>
Co-authored-by: Garrit Franke <[email protected]>
Co-authored-by: Garrit Franke <[email protected]>
Co-authored-by: smoroz <smoroz>
Co-authored-by: Spencer Wilson <[email protected]>
Co-authored-by: Luis Rivas <[email protected]>
  • Loading branch information
1 parent e97f6e1 commit e24ba22
Show file tree
Hide file tree
Showing 19 changed files with 4,370 additions and 1,207 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: ua-parser-js
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.paypal.me/faisalman/']
20 changes: 20 additions & 0 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ua-parser-js-run-test

on: [push, pull_request]

permissions:
contents: read

jobs:
run-test:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, ppc64le]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Run the test
run: |
npm install
npm run test-ci
3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"esversion": 3
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ cache:
- node_modules

sudo: false

script: npm run test-ci
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "0.7.24",
"version": "0.7.33",
"authors": [
"Faisal Salman <[email protected]>"
],
Expand Down
49 changes: 49 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# UAParser.js Changelog

# Version 0.7 / 1.0

Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.

## Version 0.7.30 / 1.0.1

- Add new browser : Obigo, UP.Browser, Klar
- Add new device : Oculus, Roku
- Add new OS: Maemo, HP-UX, Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
- Improve detection for Sony Xperia 1ii, LG Android TV, and some more devices
- Improve detection for ARM64 CPU
- Improve detection for Windows Mobile, Netscape, Mac on PowerPC
- Categorize PDA as mobile
- Fix Sharp devices misjudged as Huawei
- Fix trailing comma for ES3 compatibility
- Some code refactor

## Version 0.7.31 / 1.0.2

- Fix OPPO Reno A5 incorrect detection
- Fix TypeError Bug
- Use AST to extract regexes and verify them with safe-regex

## Version 0.7.32 / 1.0.32

- Add new browser : DuckDuckGo, Huawei Browser, LinkedIn
- Add new OS : HarmonyOS
- Add some Huawei models
- Add Sharp Aquos TV
- Improve detection Xiaomi Mi CC9
- Fix Sony Xperia 1 III misidentified as Acer tablet
- Fix Detect Sony BRAVIA as SmartTV
- Fix Detect Xiaomi Mi TV as SmartTV
- Fix Detect Galaxy Tab S8 as tablet
- Fix WeGame mistakenly identified as WeChat
- Fix included commas in Safari / Mobile Safari version
- Increase UA_MAX_LENGTH to 350

## Version 0.7.33 / 1.0.33

- Add new browser : Cobalt
- Identify Macintosh as an Apple device
- Fix ReDoS vulnerability

# Version 0.8

Version 0.8 was created by accident. This version is now deprecated and no longer maintained, please update to version 0.7 / 1.0.
13 changes: 4 additions & 9 deletions dist/ua-parser.min.js

Large diffs are not rendered by default.

13 changes: 4 additions & 9 deletions dist/ua-parser.pack.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '0.7.24',
version: '0.7.33',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
83 changes: 72 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"title": "UAParser.js",
"name": "@optimizely/ua-parser-js",
"version": "0.7.24",
"version": "0.7.33",
"author": "Faisal Salman <[email protected]> (http://faisalman.com)",
"description": "Lightweight JavaScript-based user-agent string parser",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [
"user-agent",
"parser",
Expand All @@ -20,87 +20,135 @@
"Aamir Poonawalla <[email protected]>",
"Admas <[email protected]>",
"algenon <[email protected]>",
"Alvin Portillo <[email protected]>",
"Alvin Portillo <[email protected]>",
"Amumu <[email protected]>",
"Andrea Vaghi <[email protected]>",
"Anton Zhiyanov <[email protected]>",
"Arturo Mejia <[email protected]>",
"Arun Rama Reddy <[email protected]>",
"Austin Pray <[email protected]>",
"Bendeguz <[email protected]>",
"Benjamin Bertrand <[email protected]>",
"Benjamin Urban <[email protected]>",
"boneyao <[email protected]>",
"Carl C Von Lewin <[email protected]>",
"CESAR RAMOS <[email protected]>",
"Chad Killingsworth <[email protected]>",
"Christopher De Cairos <[email protected]>",
"Cyrille David <[email protected]>",
"Dario Vladovic <[email protected]>",
"David Annez <[email protected]>",
"Davit Barbakadze <[email protected]>",
"ddivernois <[email protected]>",
"Deliaz <[email protected]>",
"Demis Palma <[email protected]>",
"dhoko <[email protected]>",
"dianhe <[email protected]>",
"dineshks1 <[email protected]@outlook.com>",
"Dmitry Tyschenko <[email protected]>",
"Douglas Li <[email protected]>",
"Dumitru Uzun <[email protected]>",
"Dustin <[email protected]>",
"Elchin Valiyev <[email protected]>",
"Emil Hesslow <[email protected]>",
"Eric Redon <[email protected]>",
"Eric Schrenker <[email protected]>",
"Erik Hesselink <[email protected]>",
"Fabian Becker <[email protected]>",
"Faisal Salman <fyzlman@gmail.com>",
"Faisal Salman <f@faisalman.com>",
"Frédéric Camblor <[email protected]>",
"Frederik Ring <[email protected]>",
"Gerald Host <[email protected]>",
"Germán M. Bravo <[email protected]>",
"Grigory Dmitrenko <[email protected]>",
"gulpin <[email protected]>",
"Hendrik Helwich <[email protected]>",
"Hermann Ebert <[email protected]>",
"hr6r <[email protected]>",
"Igor Topal <[email protected]>",
"Ildar Kamalov <[email protected]>",
"insanehong <[email protected]>",
"jackpoll <[email protected]>",
"Jake Mc <[email protected]>",
"JBYoshi <[email protected]>",
"Joey Parrish <[email protected]>",
"John Tantalo <[email protected]>",
"John Yanarella <[email protected]>",
"Jon Buckley <[email protected]>",
"Josh Goldberg <[email protected]>",
"Junki-Ishida <[email protected]>",
"Kendall Buchanan <[email protected]>",
"Lee Treveil <[email protected]>",
"leonardo <[email protected]>",
"Levente Balogh <[email protected]>",
"Liam Quinn <[email protected]>",
"Lithin <[email protected]>",
"ll-syber <[email protected]>",
"Loris Guignard <[email protected]>",
"Lukas Drgon <[email protected]>",
"Lukas Eipert <[email protected]>",
"Malash <[email protected]>",
"Martynas <[email protected]>",
"Masahiko Sato <[email protected]>",
"Matt Brophy <[email protected]>",
"Max Maurer <maxemanuel.maurer@gmail.com>",
"Matthew Origer <karatecowboy@gmail.com>",
"Maximilian Haupt <[email protected]>",
"Max Maurer <[email protected]>",
"Max Nordlund <[email protected]>",
"Michael Hess <[email protected]>",
"MimyyK <[email protected]>",
"naoh <[email protected]>",
"Nicholas Ionata <[email protected]>",
"Nikhil Motiani <[email protected]>",
"Nik Rolls <[email protected]>",
"Nikhil Motiani <nikhil.m@247-inc.com>",
"nionata <n.ionata129@gmail.com>",
"niris <[email protected]>",
"Nobuo Okada <[email protected]>",
"o.drapeza <[email protected]>",
"otakuSiD <[email protected]>",
"patrick-nurt <[email protected]>",
"Pavel Studeny <[email protected]>",
"Peter Dave Hello <[email protected]>",
"philippsimon <[email protected]>",
"Pieter Hendrickx <[email protected]>",
"Piper Chester <[email protected]>",
"Queen Vinyl Darkscratch <[email protected]>",
"Raine Makelainen <[email protected]>",
"Raman Savaryn <[email protected]>",
"Robert Tod <[email protected]>",
"roman.savarin <[email protected]>",
"Ron Korland <[email protected]>",
"Ross Noble <[email protected]>",
"ruicong <[email protected]>",
"Sandro Sonntag <[email protected]>",
"sgautrea <[email protected]>",
"Shane Gautreau <[email protected]>",
"Shane Thacker <[email protected]>",
"shchotse <[email protected]>",
"Shreedhar <[email protected]>",
"Simon Eisenmann <[email protected]>",
"Simon Lang <[email protected]>",
"Stiekel <[email protected]>",
"sUP <[email protected]>",
"Sylvain Gizard <[email protected]>",
"szchenghuang <[email protected]>",
"Tanguy Krotoff <[email protected]>",
"Tony Tomarchio <[email protected]>",
"Ulrich Schmidt <[email protected]>",
"Vadim Kurachevsky <[email protected]>",
"Yılmaz <[email protected]>",
"yuanyang <[email protected]>",
"Yun Young-jin <[email protected]>",
"Insanehong <insae.hong@navercorp.com>"
"Zach Bjornson <zbbjornson@gmail.com>"
],
"main": "src/ua-parser.js",
"files": [
"dist",
"src"
],
"scripts": {
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/UAParser\\.js/' --compress --mangle",
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
"test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js",
"verup": "node ./node_modules/verup",
"version": "node ./node_modules/verup 0"
},
Expand All @@ -112,13 +160,16 @@
],
"regs": [
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
"^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
"^(\\/?\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
]
},
"devDependencies": {
"@babel/parser": "7.15.8",
"@babel/traverse": "7.15.4",
"jshint": "~2.12.0",
"mocha": "~8.2.0",
"requirejs": "^2.3.2",
"safe-regex": "^2.1.1",
"uglify-js": "~3.12.0",
"verup": "^1.3.x"
},
Expand All @@ -137,5 +188,15 @@
},
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
"demo": "https://faisalman.github.io/ua-parser-js",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/ua-parser-js"
},
{
"type": "paypal",
"url": "https://paypal.me/faisalman"
}
]
}
Loading

0 comments on commit e24ba22

Please sign in to comment.