Firefox Tomorrow

web api instance property

HIDDevice: opened property

View on MDN ↗

Secure contextLimited availabilityAvailable in workers

The opened read-only property of the HIDDevice interface returns true if the connection to the HIDDevice is open and ready to transfer data.

Value

A boolean value, true if the connection is open.

Examples

The following example retrieves devices with getDevices() and logs the value of opened to the console.

let devices = await navigator.hid.getDevices();
devices.forEach((device) => {
  console.log(`HID: ${device.opened}`);
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.