Web Serial APIdedicated
The serial read-only property of the WorkerNavigator interface returns a Serial object which represents the worker entry point into the Web Serial API.
The same instance of the Serial object will always be returned.
Value
A Serial object.
Examples
List the 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.
});
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
