WorkerNavigator: serial property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is only available in Dedicated Web Workers.
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.
Value
A Serial
object.
Examples
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
Specification |
---|
Web Serial API # dom-workernavigator-serial |
Browser compatibility
BCD tables only load in the browser