Following the recent HIDDevice forget() addition[1] to the web platform, the USBDevice forget() method allows web developers to voluntarily revoke a permission to a USBDevice that was granted by a user. [1] https://groups.google.com/a/chromium.org/g/blink-dev/c/Fk-IJF63UWc
Motivation
Some sites may not be interested in retaining long-term permissions to access a USB device. 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 USB device. const device = await navigator.usb.requestDevice({ filters: [] }); // Then later... revoke permission to the USB device. await device.forget(); We expect similar functionality to Web Bluetooth and the Serial API to be added.
Documentation
Specification
Specification currently under development in a Working Group
Status in Chromium
Enabled by default
(tracking bug)
Consensus & Standardization
- No signal
- No signal
- Positive
Owners
Last updated on 2022-05-14