Following the recent HIDDevice[1] and USBDevice[2] forget() additions to the web platform, the SerialPort forget() method allows web developers to voluntarily revoke a permission to a SerialPort that was granted by a user. [1] https://groups.google.com/a/chromium.org/g/blink-dev/c/Fk-IJF63UWc [2] https://groups.google.com/a/chromium.org/g/blink-dev/c/pSM2W0TtKEI/

Motivation

Some sites may not be interested in retaining long-term permissions to access a serial port. For example, for an educational web application used on a shared computer with many devices, a large number of accumulated user-generated permissions creates a poor user experience. In addition to user agent mitigations to avoid this problem, such as defaulting to a session scoped permission on the first request or expiring infrequently used permissions, it should be possible for the site itself to clean up user-generated permissions it is no longer interested in retaining. // Request a serial port. const port = await navigator.serial.requestPort(); // Then later... revoke permission to the serial port. await port.forget();

Documentation

Specification

Specification link


Specification currently under development in a Working Group

Status in Chromium

Blink>Serial


Enabled by default (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No signal
  • No signal
  • Positive

Owner

Last updated on 2022-05-15