问题
I am trying to use USB RFID reader in our website. by using navigator.usb.getDevices() i am selecting my device.
open() and selectConfiguration(1) is working. but device.claimInterface(0); is giving me following error.
An attempt to claim a USB device interface has been blocked because it implements a protected interface class.
回答1:
Chrome prevents certain interfaces from being accessed for security reasons. These interfaces are the following:
- audio
- HID
- mass storage
- smart card
- video
- audio/video
- wireless controller
These are detailed in the following Chrome web test: https://cs.chromium.org/chromium/src/third_party/blink/web_tests/usb/protected-interface-classes.html?q=usb+protected+interface&sq=package:chromium&dr=C&l=9
There is a proposal for WebHID in progress, however: https://discourse.wicg.io/t/human-interface-device-hid-api/3070
来源:https://stackoverflow.com/questions/54289929/usb-device-interface-has-been-blocked