-
Notifications
You must be signed in to change notification settings - Fork 133
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
Exclusive filter in requestDevice
#232
Comments
This request seems similar to what we have done for Web Bluetooth and WebHID APIs previously. See https://chromestatus.com/features#exclusionFilters Would something similar help? |
Looking at the WebHID spec: dictionary HIDDeviceRequestOptions {
required sequence<HIDDeviceFilter> filters;
sequence<HIDDeviceFilter> exclusionFilters;
}; it's exactly what I need. |
I think this is a good idea but I wouldn't try to use it as a workaround for not having the extension to |
I don't think it's a workaround for #166. This one is about excluding devices from I don't need to know paired but disconnected device list because they won't appear in EDIT: honestly, it's a surprise for me that while WebUSB, WebHID and Web Bluetooth specs share a very similar basic device management API, they didn't evolve together. |
FYI I've just started #233 to address this issue. |
When a Web app already displays the list of paired devices (from
getDevices
), it might be a better UX to exclude those devices in the permission prompt ofrequestDevice
.If the app only has one page, that includes all operations to all connected devices, selecting an already paired device in the permission prompt might be a no-op (or the developer has to implement some prompts to tell the user that the selected device is already on the page). If the user needs to pair with many devices (for example in QA), this can also save their time finding the next unpaired device in the permission prompt.
The API design might be a simple boolean option
excludePaired
, or another array ofUSBDeviceFilter
namedexclude
to allow developers to hide certain devices matching the filters (for example using allserialNumber
s from already paired devices).The second option might also become useful to only exclude a specific old incompatible model (include all devices with
vendorId
0xABCD, exceptproductId
0x1234), instead of listing all supportedproductId
s infilters
.The text was updated successfully, but these errors were encountered: