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

Fix detect Pico devices and detect Pico Neo 3 Link #7586

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 7 additions & 3 deletions Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2108,11 +2108,15 @@
*/
protected function hasDesktopFragment(): bool
{
$regexExcludeDesktopFragment = \implode('|', [

Check failure on line 2111 in Parser/Device/AbstractDeviceParser.php

View workflow job for this annotation

GitHub Actions / PHPCS

Add a comma after each item in a multi-line array
'CE-HTML',
' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh|OculusBrowser',
'PicoBrowser|Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)'
]);

return
$this->matchUserAgent('(?:Windows (?:NT|IoT)|X11; Linux x86_64)') &&
!$this->matchUserAgent('CE-HTML') &&
!$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh|OculusBrowser') &&
!$this->matchUserAgent('Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)');
!$this->matchUserAgent($regexExcludeDesktopFragment);
}

/**
Expand Down
36 changes: 36 additions & 0 deletions Tests/fixtures/wearable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2243,3 +2243,39 @@
model: KidPhone 4G
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.8.2 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.38 Chrome/105.0.5195.68 VR Safari/537.36
os:
name: PICO OS
version: 5.8.2
platform: x64
client:
type: browser
name: PICO Browser
version: 3.3.38
engine: Blink
engine_version: 105.0.5195.68
device:
type: wearable
brand: Pico
model: "4"
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Pico Neo3 Link OS5.8.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36
os:
name: PICO OS
version: 5.8.4.0
platform: x64
client:
type: browser
name: PICO Browser
version: 3.3.22
engine: Blink
engine_version: 105.0.5195.68
device:
type: wearable
brand: Pico
model: Neo 3 Link
os_family: Android
browser_family: Chrome
8 changes: 6 additions & 2 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34090,9 +34090,13 @@ Axioo:

# Pico (https://www.picoxr.com)
Pico:
regex: 'Pico (G2 4K|Neo 3|4)(?:[);/ ]|$)'
regex: 'Pico (?:G2 4K|Neo ?3|4)(?:[);/ ]|$)'
device: 'wearable'
model: '$1'
models:
- regex: 'Neo3 Link'
model: 'Neo 3 Link'
- regex: 'Pico (G2 4K|Neo 3|4)(?:[);/ ]|$)'
model: '$1'

# STG Telecom (stgtelecom.com)
STG Telecom:
Expand Down
Loading