-
Notifications
You must be signed in to change notification settings - Fork 16.5k
feat: support HIDDevice.collections
#47391
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
Conversation
cdba608
to
46ee1b2
Compare
46ee1b2
to
2ec929f
Compare
docs/api/structures/hid-device.md
Outdated
* `productId` Integer - The USB product ID. | ||
* `serialNumber` string (optional) - The USB device serial number. | ||
* `guid` string (optional) - Unique identifier for the HID interface. A device may have multiple HID interfaces. | ||
* `collections` Object[] - an array of report formats. See [Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/collections) for more. |
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.
Since this feature isn't a web standard and is only implemented in Chrome, is there a chance that the spec changes? I see on https://wicg.github.io/webhid/ the following paragraph:
This specification was published by the Web Platform Incubator Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.
Would it be beneficial to us to mark it as experimental?
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.
@erickzhao that text applies to all WebHID, not collections
- imo it'd be a bit strange to mark this as experimental when no other part of WebHID is in our docs.
Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
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
Release Notes Persisted
|
I have automatically backported this PR to "37-x-y", please check out #47483 |
I have automatically backported this PR to "36-x-y", please check out #47484 |
* feat: support HIDDevice.collections * Update docs/api/structures/hid-device.md Co-authored-by: Erick Zhao <ezhao@slack-corp.com> --------- Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
Description of Change
Closes #43713
Improve spec adherence in the Web Hid API by properly supporting the
collections
instance properties. This allows developers to filter and make permissioning decisions based on for example theusagePage
andusage
properties of a device inselect-hid-device
and permission handlers.Checklist
npm test
passesRelease Notes
Notes: Added support for
HIDDevice.collections
.