Navigator: serial property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The serial read-only property of the Navigator interface returns a Serial object which represents the entry point into the Web Serial API.
When getting, the same instance of the Serial object will always be returned.
Value
A Serial object.
Examples
The following example uses the getPorts() method to initialize a list of available ports.
js
navigator.serial.getPorts().then((ports) => {
// Initialize the list of available ports with `ports` on page load.
});
Specifications
| Specification |
|---|
| Web Serial API # extensions-to-the-navigator-interface |
Browser compatibility
| desktop | mobile | server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- In development. Supported in a pre-release version.
- In development. Supported in a pre-release version.
- No support
- No support
- See implementation notes.