【发布时间】:2018-05-29 19:55:17
【问题描述】:
我正在尝试将 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);
我找不到有关该错误的任何信息,任何信息将不胜感激。
【问题讨论】:
标签: google-chrome webusb