thegecko / webusb

Node.js implementation of the WebUSB Specification
https://thegecko.github.io/webusb/
MIT License
183 stars 27 forks source link

only one filter needs to match #14

Closed monteslu closed 6 years ago

monteslu commented 6 years ago

Not sure this is by the spec, or just the chrome implementation, but in chrome you only need to match one of the filters in your filter list.

Perhaps .every should be .some ?

https://github.com/thegecko/webusb/blob/master/src/usb.ts#L89

thegecko commented 6 years ago

I think maybe you are right. Step 5 here:

https://wicg.github.io/webusb/#request-the-usb-permission

outlines to remove devices if they don't match a filter, therefore they only need to match one :)