From 68479c76b39f0220347c05b4018c23cacd31bf2c Mon Sep 17 00:00:00 2001 From: Greg Fodor <gfodor@gmail.com> Date: Fri, 20 Jul 2018 22:11:13 +0000 Subject: [PATCH] Add proper FxR check --- src/utils/vr-caps-detect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/vr-caps-detect.js b/src/utils/vr-caps-detect.js index 58023becc..61e160bf0 100644 --- a/src/utils/vr-caps-detect.js +++ b/src/utils/vr-caps-detect.js @@ -46,12 +46,12 @@ export async function getAvailableVREntryTypes() { const ua = navigator.userAgent; const isSamsungBrowser = browser.name === "chrome" && /SamsungBrowser/.test(ua); const isOculusBrowser = /Oculus/.test(ua); - const isFirefoxReality = /Firefox Reality/.test(ua); - const isInHMD = isOculusBrowser || isFirefoxReality; // This needs to be kept up-to-date with the latest browsers that can support VR and Hubs. // Checking for navigator.getVRDisplays always passes b/c of polyfill. const isWebVRCapableBrowser = window.hasNativeWebVRImplementation; + const isFirefoxReality = /Firefox for Android/.test(ua) && isWebVRCapableBrowser; + const isInHMD = isOculusBrowser || isFirefoxReality; const isDaydreamCapableBrowser = !!(isWebVRCapableBrowser && browser.name === "chrome" && !isSamsungBrowser); const isIDevice = AFRAME.utils.device.isIOS(); -- GitLab