Skip to content

Commit b38377c

Browse files
author
Simone Mariotti
committed
Merge #23
2 parents 819adb0 + f8a0727 commit b38377c

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/Analyser/Header/Useragent/Browser.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,13 @@ class Browser {
150150

151151
/* Webview for Android 4.4 and higher */
152152

153-
if (version.split('.').slice(1, 3).join('.') === '0.0' && (/Version\//u.test(ua) || /Release\//u.test(ua))) {
153+
if (
154+
version
155+
.split('.')
156+
.slice(1, 3)
157+
.join('.') === '0.0' &&
158+
(/Version\//u.test(ua) || /Release\//u.test(ua))
159+
) {
154160
this.data.browser.using = new Using({
155161
name: 'Chromium WebView',
156162
version: new Version({value: version.split('.')[0]}),
@@ -248,7 +254,7 @@ class Browser {
248254

249255
/* Oculus Chromium based browsers */
250256
if ((match = /OculusBrowser\/([0-9.]*)/u.exec(ua))) {
251-
this.data.browser.name = 'Oculus Internet';
257+
this.data.browser.name = 'Oculus Browser';
252258
this.data.browser.channel = null;
253259
this.data.browser.stock = true;
254260
this.data.browser.version = new Version({
@@ -261,6 +267,12 @@ class Browser {
261267
this.data.device.model = 'Gear VR';
262268
this.data.device.type = Constants.deviceType.HEADSET;
263269
}
270+
271+
if (/Pacific/.test(ua)) {
272+
this.data.device.manufacturer = 'Oculus';
273+
this.data.device.model = 'Go';
274+
this.data.device.type = Constants.deviceType.HEADSET;
275+
}
264276
}
265277
} else if (
266278
this.data.os.name &&

test/data/headset/device-gear.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
result: { browser: { name: 'Samsung Internet', version: '4.0', type: browser }, engine: { name: Blink }, os: { name: Android, version: 6.0.1 }, device: { type: headset, manufacturer: Samsung, model: 'Gear VR' } }
1313
-
1414
headers: 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; SM-G920F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.1.0 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36'
15-
readable: 'Oculus Internet 3.1 on a Samsung Gear VR running Android 6.0.1'
16-
result: { browser: { name: 'Oculus Internet', version: '3.1', type: browser }, engine: { name: Blink }, os: { name: Android, version: 6.0.1 }, device: { type: headset, manufacturer: Samsung, model: 'Gear VR' } }
15+
readable: 'Oculus Browser 3.1 on a Samsung Gear VR running Android 6.0.1'
16+
result: { browser: { name: 'Oculus Browser', version: '3.1', type: browser }, engine: { name: Blink }, os: { name: Android, version: 6.0.1 }, device: { type: headset, manufacturer: Samsung, model: 'Gear VR' } }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-
2+
headers: 'User-Agent: Mozilla/5.0 (Linux; Android 7.1.2; Pacific Build/N2G48H) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/4.6.0.114370170 SamsungBrowser/4.0 Chrome/61.0.3163.141 Mobile VR Safari/537.36'
3+
readable: 'Oculus Browser 4.6 on an Oculus Go running Android 7.1.2'
4+
result: { browser: { name: 'Oculus Browser', version: '4.6', type: browser }, engine: { name: Blink }, os: { name: Android, version: 7.1.2 }, device: { type: headset, manufacturer: Oculus, model: 'Go' } }

0 commit comments

Comments
 (0)