A few years ago I wrote an article about how to detect VR support with JavaScript. Since that time, a whole lot has changed. “Augmented reality” became a thing and terminology has moved to “XR”, instead of VR or AR. As such, the API has needed to evolve.
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.
5 More HTML5 APIs You Didn’t Know Existed
The HTML5 revolution has provided us some awesome JavaScript and HTML APIs. Some are APIs we knew we’ve needed for years, others are cutting edge mobile and desktop helpers. Regardless of API strength or purpose, anything to help us better do our job is a…
CSS Selection Styling
The goal of CSS is to allow styling of content and structure within a web page. We all know that, right? As CSS revisions arrive, we’re provided more opportunity to control. One of the little known styling option available within the browser is text selection styling.
Source link