Firefox Tomorrow

web api instance property

Navigator: serial property

View on MDN ↗

Secure context

The serial read-only property of the Navigator interface returns a Serial object, which represents the entry point into the Web Serial API.

The same instance of the Serial object will always be returned.

Value

A Serial object.

Examples

List available ports

The following example uses the getPorts() method to initialize a list of available ports.

navigator.serial.getPorts().then((ports) => {
  // Initialize the list of available ports with `ports` on page load.
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also