SerialPort.onconnect

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

The onconnect 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..

Syntax

SerialPort.onconnect = function(event);
SerialPort.addEventListener('connect', function(event));

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
onconnect
89
89
No
No
No
No
No
No
No
No
No
No

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/onconnect