e01.org

USBConnectionEvent: USBConnectionEvent() constructor

WebUSB API

WebUSB API

The **`USBConnectionEvent()`** constructor creates a new USBConnectionEvent object.
This constructor is not typically used,
it is created by the browser in response to the connection and disconnection of a USB device.

## Syntax

```js-nolint
new USBConnectionEvent(type, options)
```

### Parameters

- `type`
- : A string with the name of the event.
It is case-sensitive and browsers set it to `connect` or `disconnect`.
- `options`
- : An object that, _in addition of the properties defined in Event()_, can have the following properties:
- `device`
- : A USBDevice representing the USB device being connected or disconnected.

### Return value

A new USBConnectionEvent object.

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

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

JSON record · API collection · citation policy