-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for WebUSB #36289
feat: add support for WebUSB #36289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the API review. Code review is next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Co-authored-by: Charles Kerr <charles@charleskerr.com>
5e766b0
to
f4c37e5
Compare
…vationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595
Release Notes Persisted
|
API LGTM |
The device list is always empty. See #36615. |
* feat: add support for WebUSB * fixup for gn check * fixup gn check on Windows * Apply review feedback Co-authored-by: Charles Kerr <charles@charleskerr.com> * chore: address review feedback * chore: removed unneeded code * Migrate non-default ScopedObservation<> instantiations to ScopedObservationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595 Co-authored-by: Charles Kerr <charles@charleskerr.com>
Description of Change
This PR enables use of the WebUSB API in Electron by exposing several new events on Session:
select-usb-device
- fired whennavigator.usb.requestDevice
is called so that an Electron developer can programmatically select a USB device.usb-device-added
- emitted afternavigator.usb.requestDevice
has been called andselect-usb-device
has fired if a new device becomes available before the callback fromselect-usb-device
is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.usb-device-removed
- emitted afternavigator.usb.requestDevice
has been called andselect-usb-device
has fired if a device has been removed before the callback fromselect-usb-device
is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.usb-device-revoked
- emitted afterUSBDevice.forget()
has been called. This event can be used to help maintain persistent storage of permissions whensetDevicePermissionHandler
is used.Additionally,
setDevicePermissionHandler(handler)
on Session has been updated to allow developers to provide default permissioning to devices without callingnavigator.usb.requestDevice
first.Checklist
npm test
passesRelease Notes
Notes: Added support for WebUSB