MDN self-hosted library · e01.org

HIDDevice: opened property

WebHID APIwindowandworkerexceptshared

Open notebook · 1 cells web-api-instance-property upstream source

WebHID APIwindow_and_worker_except_shared

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 HID.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

Browser compatibility