Firefox Tomorrow

web api instance property

HIDDevice: productName property

View on MDN ↗

Secure contextLimited availabilityAvailable in workers

The productName read-only property of the HIDDevice interface returns the product name of the connected HID device.

Value

A string.

Examples

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

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.