e01.org

USBConnectionEvent: device property

WebUSB API

WebUSB API

The **`device`** read-only property of the USBConnectionEvent interface returns a USBDevice object representing the device being connected or disconnected.

## Value

A USBDevice object.

## Examples

Connecting a USB device fires the `connect` event. The current USBDevice is returned by calling `event.device`.

```js
navigator.usb.addEventListener("connect", (event) => {
console.log(event.device);
});
```

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"USBConnectionEvent: device property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/USBConnectionEvent/device

JSON record · API collection · citation policy