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

Add Oculus Quest and Oculus Quest 2, as well as another test for Oculus Browser #528

Merged
merged 5 commits into from
Oct 6, 2021
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
7 changes: 5 additions & 2 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
SAMSUNG = 'Samsung',
SONY = 'Sony',
XIAOMI = 'Xiaomi',
ZEBRA = 'Zebra';
ZEBRA = 'Zebra',
FACEBOOK = 'Facebook';

///////////
// Helper
Expand Down Expand Up @@ -278,7 +279,7 @@

// WebView
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android
], [[NAME, 'Facebook'], VERSION], [
], [[NAME, FACEBOOK], VERSION], [
/safari (line)\/([\w\.]+)/i, // Line App for iOS
/\b(line)\/([\w\.]+)\/iab/i, // Line App for Android
/(chromium|instagram)[\/ ]([-\w\.]+)/i // Chromium/Instagram
Expand Down Expand Up @@ -631,6 +632,8 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/droid.+; (wt63?0{2,3})\)/i
], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [
/(quest( 2)?)/i // Oculus Quest
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [

///////////////////
// EMBEDDED
Expand Down
10 changes: 10 additions & 0 deletions test/browser-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,16 @@
"major" : "3"
}
},
{
"desc" : "Oculus Browser",
"ua" : "Mozilla/5.0 (Linux; Android 10; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36",
"expect" :
{
"name" : "Oculus Browser",
"version" : "15.0.0.0.22.280317669",
"major" : "15"
}
},
{
"desc" : "OmniWeb",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48",
Expand Down
18 changes: 18 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,24 @@
"type": "mobile"
}
},
{
"desc": "Oculus Quest",
"ua": "Mozilla/5.0 (Linux; Android 10; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36",
"expect": {
"vendor": "Facebook",
"model": "Quest",
"type": "wearable"
}
},
{
"desc": "Oculus Quest 2",
"ua": "Mozilla/5.0 (Linux; Android 10; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36",
"expect": {
"vendor": "Facebook",
"model": "Quest 2",
"type": "wearable"
}
},
{
"desc": "OnePlus One",
"ua": "Mozilla/5.0 (Linux; Android 4.4.4; A0001 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.59 Mobile Safari/537.36",
Expand Down