6

我正在尝试将 WebUSB api 与 Chrome 67 一起使用。以下代码在一个月前工作。我不确定是否有所改变,或者我是否遗漏了什么。我现在遇到的错误是在我尝试声明接口时发生的。

错误消息如下:DOMException: The requested interface implements a protected class.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);

我找不到有关该错误的任何信息,任何信息将不胜感激。

4

1 回答 1

4

我在这里宣布了这一变化:

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

于 2018-05-30T14:44:13.403 回答