diff --git a/src/hub.js b/src/hub.js index e3f759cfd5d8a0c1627d8b85c54933de961acd3b..a9ac40c324785aab8218a2d871b54e401365c0e5 100644 --- a/src/hub.js +++ b/src/hub.js @@ -389,12 +389,13 @@ document.addEventListener("DOMContentLoaded", async () => { if (availableVREntryTypes.isInHMD) { remountUI({ availableVREntryTypes, forcedVREntryType: "vr" }); - // 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; + if (/Oculus/.test(navigator.userAgent)) { + // HACK - The polyfill reports Cardboard as the primary VR display on startup out ahead of Oculus Go on Oculus Browser 5.5.0 beta. 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 }); }