WorkerNavigator.serial

The serial read-only property of the WorkerNavigator 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.

Syntax

var serialObj = self.navigator.serial;

Value

A Serial object.

Examples

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

self.navigator.serial.getPorts()
.then((ports) => {
  // Initialize the list of available ports.
});

Specifications

Specification Status Comment
Web Serial API
The definition of 'Extensions to the Worker Navigator Interface' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also