Skip to content

Instantly share code, notes, and snippets.

@heaversm
Created April 5, 2020 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heaversm/0f3f083411ec0f9515faa61196a87999 to your computer and use it in GitHub Desktop.
Save heaversm/0f3f083411ec0f9515faa61196a87999 to your computer and use it in GitHub Desktop.
Fixes for some weird but crucial bugs in JS
//Polyfill for aframe/threejs raycasting
//navigator.xr.requestDevice is not a function
//see https://github.com/aframevr/aframe/issues/4354#issuecomment-567052948
navigator.xr.requestDevice = navigator.xr.requestDevice || function () {
return new Promise((resolve, reject) => {
resolve({
supportsSession: new Promise((resolve, reject) => {
resolve({
immersive: true,
exclusive: true
});
})
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment