WebUSB API protected interface class error

2020-07-11 08:15发布

问题:

I'm trying to use the WebUSB api with Chrome 67. The following code was working a month ago. I'm not sure if something is changed or if I missing something. The error I'm getting now is occurring when I'm trying to claim the interface.

The error messages are as follows: DOMException: The requested interface implements a protected class. and An attempt to claim a USB device interface has been blocked because it implements a protected interface class.

  window.setInterval(function() {
    navigator.usb.getDevices({ filters: [{ vendorId: 0x0b67 }]
    }).then(function(devices) {
      device = devices[0];
      return device.open();
    }).then(function() {
      return device.selectConfiguration(1);
    }).then(function() {
      return device.claimInterface(0);
    }).then(function() {
      return device.transferIn(1, 6);

I can't find any information about the error, any information would be appreciated.

回答1:

I announced this change here:

https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/LZXocaeCwDw/GLfAffGLAAAJ