Skip to content
New issue

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

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

Already on GitHub? # to your account

Adds detection for Meta Horizon #7928

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 8 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class OperatingSystem extends AbstractParser
'MAG' => 'Mageia',
'MDR' => 'Mandriva',
'SMG' => 'MeeGo',
'MET' => 'Meta Horizon',
'MCD' => 'MocorDroid',
'MON' => 'moonOS',
'EZX' => 'Motorola EZX',
Expand Down Expand Up @@ -234,7 +235,7 @@ class OperatingSystem extends AbstractParser
'Android' => [
'AND', 'CYN', 'FIR', 'REM', 'RZD', 'MLD', 'MCD', 'YNS', 'GRI', 'HAR',
'ADR', 'CLR', 'BOS', 'REV', 'LEN', 'SIR', 'RRS', 'WER', 'PIC', 'ARM',
'HEL', 'BYI', 'RIS', 'PUF', 'LEA',
'HEL', 'BYI', 'RIS', 'PUF', 'LEA', 'MET',
],
'AmigaOS' => ['AMG', 'MOR', 'ARO'],
'BlackBerry' => ['BLB', 'QNX'],
Expand Down Expand Up @@ -452,6 +453,12 @@ public function parse(): ?array
$version = '';
$short = $osFromUserAgent['short_name'];
}

// Meta Horizon is reported as Linux in client hints
if ('GNU/Linux' === $name && 'Meta Horizon' === $osFromUserAgent['name']) {
$name = $osFromUserAgent['name'];
$short = $osFromUserAgent['short_name'];
}
} elseif (!empty($osFromUserAgent['name'])) {
$name = $osFromUserAgent['name'];
$version = $osFromUserAgent['version'];
Expand Down
8 changes: 4 additions & 4 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3602,16 +3602,16 @@
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/20.0.0.3.8.358844291 SamsungBrowser/4.0 Chrome/98.0.4758.119 VR Safari/537.36
os:
name: Android
short_name: AND
name: Meta Horizon
short_name: MET
version: ""
platform: x64
family: Android
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/22.2.0.3.39.382455783 SamsungBrowser/4.0 Chrome/102.0.5005.148 VR Safari/537.36
os:
name: Android
short_name: AND
name: Meta Horizon
short_name: MET
version: ""
platform: x64
family: Android
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/clienthints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@
Sec-CH-UA-Platform: "Linux"
Sec-CH-UA-Mobile: "?0"
os:
name: GNU/Linux
name: Meta Horizon
version: ""
platform: x64
client:
Expand All @@ -813,7 +813,7 @@
type: wearable
brand: Meta
model: Quest 2
os_family: GNU/Linux
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smart_display.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@
-
user_agent: Mozilla/5.0 (Linux; Android 10; PortalGo) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.9999.0 Safari/537.36
os:
name: Android
version: "10"
name: Meta Horizon
version: ""
platform: ""
client:
type: browser
Expand Down
22 changes: 11 additions & 11 deletions Tests/fixtures/wearable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,8 @@
-
user_agent: Mozilla/5.0 (Linux; Android 7.1.1; Pacific) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/10.16.0.0.0.296461555 SamsungBrowser/4.0 Chrome/91.0.4472.88 Mobile VR Safari/537.36
os:
name: Android
version: 7.1.1
name: Meta Horizon
version: ""
platform: ""
client:
type: browser
Expand All @@ -999,8 +999,8 @@
-
user_agent: Mozilla/5.0 (Linux; Android 7.1.1; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/13.4.0.3.15.268829550 SamsungBrowser/4.0 Chrome/87.0.4280.141 VR Safari/537.36
os:
name: Android
version: 7.1.1
name: Meta Horizon
version: ""
platform: ""
client:
type: browser
Expand All @@ -1017,8 +1017,8 @@
-
user_agent: Mozilla/5.0 (Linux; Android 10; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/13.0.0.2.16.259832224 SamsungBrowser/4.0 Chrome/87.0.4280.66 VR Safari/537.36
os:
name: Android
version: "10"
name: Meta Horizon
version: ""
platform: ""
client:
type: browser
Expand All @@ -1035,8 +1035,8 @@
-
user_agent: Mozilla/5.0 (Linux; Android 10; Standalone HMD) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/8.5.0.4.24.209184609 SamsungBrowser/4.0 Chrome/79.0.3945.126 Mobile VR Safari/537.36
os:
name: Android
version: "10"
name: Meta Horizon
version: ""
platform: ""
client:
type: browser
Expand Down Expand Up @@ -1465,7 +1465,7 @@
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/22.2.0.3.39.382455783 SamsungBrowser/4.0 Chrome/102.0.5005.148 VR Safari/537.36
os:
name: Android
name: Meta Horizon
version: ""
platform: x64
client:
Expand Down Expand Up @@ -2313,7 +2313,7 @@
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/32.1.0.37.133.575621010 Chrome/122.0.6261.64 VR Safari/537.36
os:
name: Android
name: Meta Horizon
version: ""
platform: x64
client:
Expand All @@ -2331,7 +2331,7 @@
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/32.1.0.37.133.575621010 Chrome/122.0.6261.64 VR Safari/537.36
os:
name: Android
name: Meta Horizon
version: ""
platform: x64
client:
Expand Down
9 changes: 8 additions & 1 deletion regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
###############

##########
# Meta Horizon (https://developers.meta.com/horizon)
##########
- regex: '(?:Pacific|(?<!like )Quest).+OculusBrowser|Standalone HMD|PortalGo'
name: 'Meta Horizon'
version: ''

##########
# LeafOS (https://www.leafos.org/)
##########
Expand Down Expand Up @@ -835,7 +842,7 @@
name: 'Android'
version: ''

- regex: 'BeyondPod|AntennaPod|Podkicker|DoggCatcher|okhttp|Podcatcher Deluxe|Sonos/.+\(ACR_|Linux x86_64; Quest|.*WhatsApp/.*A$'
- regex: 'BeyondPod|AntennaPod|Podkicker|DoggCatcher|okhttp|Podcatcher Deluxe|Sonos/.+\(ACR_|.*WhatsApp/.*A$'
name: 'Android'
version: ''

Expand Down
Loading