This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The hardwareUnitId read-only property of the VRDevice interface returns the distinct hardware ID for the overall hardware unit that this VRDevice is a part of. All devices that are part of the same physical piece of hardware will have the same hardwareUnitId.


var hardwareID = VRDevice.hardwareUnitId;


A DOMString containing the ID of the overall hardware unit.


The following snippet (see our VRDevice example) returns an array of all the VRDevices connected to your computer via Navigator.getVRDevices(). For each connected device it then prints out the hardwareUnitId, VRDevice.deviceId, and VRDevice.deviceName.

var list = document.querySelector('ul');
var info = document.querySelector('p');
if(navigator.getVRDevices) {
  navigator.getVRDevices().then(function(myDevices) {
} else {
  info.textContent = 'WebVR API not supported by this browser.'

function reportDevices(devices) {
  for(i = 0; i < devices.length; i++) {
    var listItem = document.createElement('li');
    listItem.innerHTML = 'Device ' + (i+1)
                 + ': <strong>Hardware ID</strong>: ' + devices[i].hardwareUnitId
                 + ', <strong>VD Device ID</strong>: ' + devices[i].deviceId
                 + ', <strong>VR Device Name</strong>: ' + devices[i].deviceName
                 + '.';

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera ? Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android No support No


No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also