Permissions-Policy: serial directive
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
The HTTPPermissions-Policy headerserial directive controls whether the current document is allowed to use theWeb Serial API to communicate with serial devices, either directly connected via a serial port, or via USB or Bluetooth devices emulating a serial port.
Specifically, where a defined policy blocks use of this feature,Serial.requestPort() andSerial.getPorts() calls will return aPromise that rejects with aDOMException of typeSecurityError.
In this article
Syntax
Permissions-Policy: serial=<allowlist>;<allowlist>A list of origins for which permission is granted to use the feature. See
Permissions-Policy> Syntax for more details.
Default policy
The default allowlist forserial isself.
Specifications
| Specification |
|---|
| Web Serial API> # permissions-policy> |