From 67814555894cee492d71a7a11a3dba982352b33e Mon Sep 17 00:00:00 2001 From: Brian Peiris <brianpeiris@gmail.com> Date: Fri, 2 Nov 2018 18:41:45 -0700 Subject: [PATCH] Fix Firefox Reality detection --- src/utils/vr-caps-detect.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/vr-caps-detect.js b/src/utils/vr-caps-detect.js index fc2737ad4..c2869cb62 100644 --- a/src/utils/vr-caps-detect.js +++ b/src/utils/vr-caps-detect.js @@ -23,8 +23,10 @@ function isMaybeDaydreamCompatibleDevice(ua) { const GENERIC_ENTRY_TYPE_DEVICE_BLACKLIST = [/cardboard/i]; export function detectInHMD() { - const isOculusBrowser = /Oculus/.test(navigator.userAgent); - return isOculusBrowser; + const ua = navigator.userAgent; + const isFirefoxReality = /Firefox/.test(ua) && /Android/.test(ua) && window.hasNativeWebVRImplementation; + const isOculusBrowser = /Oculus/.test(ua); + return isOculusBrowser || isFirefoxReality; } // Tries to determine VR entry compatibility regardless of the current browser. -- GitLab