From 1a5b580a57bdcbcfa79e099b068a475352274a62 Mon Sep 17 00:00:00 2001 From: Greg Fodor <gfodor@gmail.com> Date: Tue, 13 Nov 2018 20:20:58 +0000 Subject: [PATCH] Always apply hack on oculus browser or fxr --- src/hub.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hub.js b/src/hub.js index 3f636339b..e3f759cfd 100644 --- a/src/hub.js +++ b/src/hub.js @@ -389,14 +389,12 @@ document.addEventListener("DOMContentLoaded", async () => { if (availableVREntryTypes.isInHMD) { remountUI({ availableVREntryTypes, forcedVREntryType: "vr" }); - if (AFRAME.utils.device.getVRDisplay().displayName.indexOf("Cardboard") >= 0) { - // HACK - The polyfill reports Cardboard as the primary VR display on startup - // out ahead of Oculus Go on Oculus Browser 5.5.0. This display is cached by A-Frame, - // so we need to resolve that and get the real VRDisplay before entering as well. - const displays = await navigator.getVRDisplays(); - const vrDisplay = displays.length && displays[0]; - AFRAME.utils.device.getVRDisplay = () => vrDisplay; - } + // HACK - The polyfill reports Cardboard as the primary VR display on startup + // out ahead of Oculus Go on Oculus Browser 5.5.0. This display is cached by A-Frame, + // so we need to resolve that and get the real VRDisplay before entering as well. + const displays = await navigator.getVRDisplays(); + const vrDisplay = displays.length && displays[0]; + AFRAME.utils.device.getVRDisplay = () => vrDisplay; } else { remountUI({ availableVREntryTypes }); } -- GitLab