Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds detection for Jaunt, PhantomJS and improves detection for other libraries #7768

Merged
merged 15 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public function __construct(string $userAgent = '', ?ClientHints $clientHints =
$this->addClientParser(new MobileApp());
$this->addClientParser(new MediaPlayer());
$this->addClientParser(new PIM());
$this->addClientParser(new Browser());
$this->addClientParser(new Library());
$this->addClientParser(new Browser());
liviuconcioiu marked this conversation as resolved.
Show resolved Hide resolved

$this->addDeviceParser(new HbbTv());
$this->addDeviceParser(new ShellTv());
Expand Down
24 changes: 24 additions & 0 deletions Tests/Parser/Client/fixtures/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -689,3 +689,27 @@
type: library
name: IPinfo
version: 3.0.0
-
user_agent: Jaunt/1.5
client:
type: library
name: Jaunt
version: "1.5"
-
user_agent: Android.LVLDM
client:
type: library
name: Android License Verification Library
version: ""
-
user_agent: Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/12.1.0 Chrome/106.0.5249.51 Electron/21.0.0 Safari/537.36
client:
type: library
name: Cypress
version: 12.1.0
-
user_agent: Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1
client:
type: library
name: PhantomJS
version: 2.1.1
9 changes: 0 additions & 9 deletions Tests/fixtures/bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7035,15 +7035,6 @@
producer:
name: Ghost Inspector, Inc.
url: https://www.ghostinspector.com/
-
user_agent: Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/12.1.0 Chrome/106.0.5249.51 Electron/21.0.0 Safari/537.36
bot:
name: Cypress
category: Site Monitor
url: https://github.com/cypress-io/cypress
producer:
name: Cypress.io, Inc.
url: https://www.cypress.io/
-
user_agent: Google-Area120-PrivacyPolicyFetcher
bot:
Expand Down
18 changes: 0 additions & 18 deletions Tests/fixtures/podcasting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,24 +494,6 @@
model: ""
os_family: Unknown
browser_family: Unknown
-
user_agent: Android.LVLDM
os:
name: Android
version: ""
platform: ""
client:
type: browser
name: Android Browser
version: ""
engine: WebKit
engine_version: ""
device:
type: ""
brand: ""
model: ""
os_family: Android
browser_family: Android Browser
-
user_agent: PRDownloader
os: [ ]
Expand Down
8 changes: 0 additions & 8 deletions regexes/bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4219,14 +4219,6 @@
name: 'Ghost Inspector, Inc.'
url: 'https://www.ghostinspector.com/'

- regex: 'Cypress/[\d.]+'
name: 'Cypress'
category: 'Site Monitor'
url: 'https://github.com/cypress-io/cypress'
producer:
name: 'Cypress.io, Inc.'
url: 'https://www.cypress.io/'

- regex: 'Google-Apps-Script'
name: 'Google Apps Script'
category: 'Service Agent'
Expand Down
23 changes: 20 additions & 3 deletions regexes/client/libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
###############

- regex: 'PhantomJS(?:/(\d+[\.\d]+))?'
name: 'PhantomJS'
version: '$1'
url: 'https://phantomjs.org/'

- regex: 'IPinfoClient/.*/(\d+[\.\d]+)'
name: 'IPinfo'
version: '$1'
Expand Down Expand Up @@ -71,7 +76,7 @@
url: 'https://azure.microsoft.com/en-us/products/data-factory/'

# Dart
- regex: 'Dart(?:/(\d+[\.\d]+))?'
- regex: 'Dart/(\d+[\.\d]+)'
name: 'Dart'
version: '$1'
url: 'https://dart.dev/'
Expand Down Expand Up @@ -124,6 +129,18 @@
version: '$1'
url: 'https://www.slimerjs.org/'

# Jaunt
- regex: 'Jaunt/(\d+[\.\d]+)'
name: 'Jaunt'
version: '$1'
url: 'https://jaunt-api.com/'

# Cypress
- regex: 'Cypress/(\d+[\.\d]+)'
name: 'Cypress'
version: '$1'
url: 'https://github.com/cypress-io/cypress'

- regex: 'Wget(?:/(\d+[\.\d]+))?'
name: 'Wget'
version: '$1'
Expand Down Expand Up @@ -162,7 +179,7 @@
name: 'Java HTTP Client'
version: '$1'

- regex: 'Java(?:/?(\d+[\.\d]+))?'
- regex: 'Java/?(\d+[\.\d]+)'
name: 'Java'
version: '$1'

Expand Down Expand Up @@ -215,7 +232,7 @@
version: '$1'
url: 'https://github.com/lostisland/faraday'

- regex: '(?:Go-http-client|Go )/?(?:(\d+[\.\d]+))?(?: package http)?'
- regex: '(?:Go-http-client|^Go )/?(?:(\d+[\.\d]+))?(?: package http)?'
name: 'Go-http-client'
version: '$1'

Expand Down
2 changes: 1 addition & 1 deletion regexes/client/mobile_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2536,7 +2536,7 @@
version: '$1'

# Electron generic apps
- regex: ' (?!(?:AppleWebKit|brave|Franz|Mailspring|Notion|Basecamp|Evernote|catalyst|ramboxpro|BlueMail|BeakerBrowser|Dezor|TweakStyle|Colibri|Polypane|VibeMate|(?:d|LT|Glass|Sushi|Flash|OhHai)Browser|Sizzy))([a-z0-9]*)(?:-desktop|-electron-app)?/(\d+\.[\d.]+).*Electron/'
- regex: ' (?!(?:AppleWebKit|brave|Cypress|Franz|Mailspring|Notion|Basecamp|Evernote|catalyst|ramboxpro|BlueMail|BeakerBrowser|Dezor|TweakStyle|Colibri|Polypane|VibeMate|(?:d|LT|Glass|Sushi|Flash|OhHai)Browser|Sizzy))([a-z0-9]*)(?:-desktop|-electron-app)?/(\d+\.[\d.]+).*Electron/'
name: '$1'
version: '$2'

Expand Down
Loading