Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper FxR check #468

Merged
merged 5 commits into from
Jul 20, 2018
Merged

Add proper FxR check #468

merged 5 commits into from
Jul 20, 2018

Conversation

gfodor
Copy link
Contributor

@gfodor gfodor commented Jul 20, 2018

My speculative FxR check is wrong since we are using the Fennec UA. This seems like a sane check but wanted to make sure I wasn't missing something.

To be clear, we are not using user agent checks to determine device capabilities -- we're using them to determine if the user is currently already in a HMD. My understanding is there's no other way to do this right now.

@gfodor gfodor requested a review from cvan July 20, 2018 22:12

// 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 = "buildID" in navigator && isWebVRCapableBrowser;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there you go:

const isFirefoxReality = window.orientation === 0 && ("buildID" in navigator) && isWebVRCapableBrowser;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants