The presence of
navigator.xr signals that the browser supports the WebXR API and XR devices:
const supportsXR = 'xr' in window.navigator;
I really like using
in for feature checking rather than
if(navigator.xr), as simply invoking that could cause some initialization to take place. In future posts we'll explore identifying and connecting to different devices.
Client-side APIs on mobile and desktop devices are quickly providing the same APIs. Of course our mobile devices got access to some of these APIs first, but those APIs are slowly making their way to the desktop. One of those APIs is the getUserMedia API...
I work with an awesome cast of developers at Mozilla, and one of them in Daniel Buchner. Daniel's shared with me an awesome strategy for detecting when nodes have been injected into a parent node without using the deprecated DOM Events API.