USB.ondisconnect

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The ondisconnect property of the USB is an event handler called whenever a paired device is disconnected. It is passed an instance of USBConnectionEvent.

Syntax

USB.ondisconnect = disconnectFunction

Specifications

Specification
WebUSB API
# ref-for-dom-usb-ondisconnect

Browser compatibility

BCD tables only load in the browser