Open yoichiro opened 3 years ago
This seems like a nice improvement that would also benefit other APIs that use a chooser-based permission dialog. (WebUSB, Serial, etc)
It seems like the exclusionFilters option proposal at https://github.com/WICG/webhid/pull/93 could help as well with this feature request.
I want to add a new filter option to exclude already-authorized devices for the
requestDevice
method.Currently, there is no such option. Therefore, users see all connected devices including devices which was already authorized on the dialog opened by calling the
requestDevice
method.In the other hand, we can get all authorized devices by calling the
getDevices
method. Generally, most apps should call thegetDevices
method at launching for the purpose of displaying a device list, I guess. Also, most apps should keep and manage the list of authorized devices.If a user selects already-authorized devices from the dialog opened by calling the
requestDevice
method, we need to check whether the selected device is included in the list of the result retrieved from callinggetDevices
method or not. However, if there is an option to exclude already-authorized devices from the device list on the dialog opened by calling therequestDevice
method, it is unnecessary.