Navigator.serial
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.
Syntax
var serialObj = navigator.serial;
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 with `ports` on page load. });
Specifications
Specification |
---|
Web Serial API # extensions-to-the-navigator-interface |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
serial |
89 |
89 |
No |
No |
No |
No |
No |
No |
No |
No |
No |
No |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/serial