Secure context

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

The ondisconnect event handler of the SerialPort interface is called when the port has disconnected from the device. This method receives an Event object. This event is only fired for ports associated with removable devices such as those connected via USB. This event bubbles to the instance of Serial that returned this interface.


SerialPort.ondisconnect = function(event);
SerialPort.addEventListener('disconnect', function(event));


Specification Status Comment
Web Serial API
The definition of 'SerialPort.ondisconnect' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser