我正在尝试将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);
Run Code Online (Sandbox Code Playgroud)
我找不到有关该错误的任何信息,任何信息将不胜感激。