v148 · Devices · demo

Port Explorer

Request access to a serial port and inspect its metadata — vendor ID, product ID, and USB class — using navigator.serial.requestPort(). Works on desktop Chrome and Android Chrome 148+.

Checking Web Serial API…
No port selected yet. Click the button above to open the browser port picker.
How the permission flow works
1
Your code calls navigator.serial.requestPort(). This must happen inside a user gesture (click, tap).
2
Chrome shows a port picker. On desktop it lists COM ports and USB serial devices. On Android 148+ it lists USB-OTG devices and Bluetooth serial devices paired to the phone.
3
Once the user selects a port and approves, your code receives a SerialPort object. The permission is remembered — navigator.serial.getPorts() returns it on future visits.
4
Call port.getInfo() to read usbVendorId, usbProductId, and usbClass without opening the port. Opening requires baud rate, data bits, stop bits, and parity.
// Request a port (must be in a user gesture)
const port = await navigator.serial.requestPort();

// Read metadata without opening
const info = port.getInfo();
console.log(info.usbVendorId);   // e.g. 0x2341 (Arduino)
console.log(info.usbProductId);  // e.g. 0x0043
console.log(info.usbClass);      // e.g. 2 (CDC — serial over USB)

// Get previously granted ports
const ports = await navigator.serial.getPorts();
console.log(ports.length, 'remembered port(s)');

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗