navigator.serial is a read-only property that returns a Serial object — the entry point to the Web Serial API for finding and connecting to serial ports from a web page (MDN). The same Serial instance is always returned.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use navigator.serial. Start with this line.
JavaScript
navigator.serial
Call
What it does
navigator.serial
Primary signature.
Built into the browser. Read navigator.serial on Navigator — no import required.
Library declarations
JavaScript
navigator.serial
Parameters
Parameter
Description
HTTPS
Required. Secure-context requirement
Return Value
Return Value
Description
*
The current value of navigator.serial.
JavaScript Examples
Example 1 — Feature-Detect Support
Check whether Web Serial is available before calling methods.
JavaScript
if ("serial" in navigator && navigator.serial) {
console.log("Web Serial available");
} else {
console.log("Web Serial missing");
}
console.log("secure context: " + window.isSecureContext);
no port selected
/* or: port selected
or: Web Serial missing */
How It Works
User gesture. MDN: requestPort() needs transient activation (a click).
Picker. The browser shows available serial devices.
Success. Promise resolves with a SerialPort.
Cancel. Promise rejects — catch it and keep the UI calm.
Compatibility
Browser Support
navigator.serial has limited availability and is not Baseline. It requires a secure context. Feature-detect and provide a non-serial fallback for unsupported browsers.
✓ Limited availability · Secure context
Navigator.serial
Entry point to the Web Serial API. Best supported in Chromium-based browsers. Use getPorts() for known devices and requestPort() from a user gesture.
LimitedNot Baseline
Google ChromeSupported · Desktop (secure context)
Supported
Microsoft EdgeSupported · Chromium (secure context)
Supported
OperaChromium-based / supported where available
Supported
Mozilla FirefoxNot available
No support
Apple SafariNot available
No support
Internet ExplorerNot available
No support
serialLimited
Bottom line: Detect navigator.serial, require HTTPS, call requestPort from a click, and never assume every browser can talk to serial hardware.
Frequently Asked Questions
It is a read-only Navigator property that returns a Serial object — the entry point for the Web Serial API so your page can find and connect to serial ports (including USB devices that present as a serial port).
MDN does not mark it Deprecated or Experimental. It has Limited availability (not Baseline) and requires a secure context. Always feature-detect and check browser support.
Yes. It is available only in secure contexts (HTTPS or localhost) in supporting browsers.
navigator.serial.requestPort(options) opens the browser’s port picker so the user can grant access to a selected serial device. Call it from a user gesture such as a button click. It resolves to a SerialPort.
navigator.serial.getPorts() returns ports the site already has access to. Use it on page load to reconnect without showing a new picker.
Unsupported browser, insecure context, or a Permissions Policy that blocks the serial feature — the property may not be available when blocked.