I don't seem to be able to claim hid interface using webusb. I'm trying to write a yubikey OATH wrapper
navigator.usb.requestDevice({filters: filters}).then(...);
USBDevice {usbVersionMajor: 2, usbVersionMinor: 0, usbVersionSubminor: 0, deviceClass: 0, deviceSubclass: 0, …}configuration: USBConfiguration {configurationValue: 1, configurationName: null, interfaces: Array(2)}configurations: [USBConfiguration]deviceClass: 0deviceProtocol: 0deviceSubclass: 0deviceVersionMajor: 3deviceVersionMinor: 4deviceVersionSubminor: 9manufacturerName: "Yubico"opened: falseproductId: 273productName: "Yubikey NEO OTP+CCID"serialNumber: "0005610818"usbVersionMajor: 2usbVersionMinor: 0usbVersionSubminor: 0vendorId: 4176__proto__: USBDevice // ykey contains the device now USBDevice {usbVersionMajor: 2, usbVersionMinor: 0, usbVersionSubminor: 0, deviceClass: 0, deviceSubclass: 0, …}
ykey.open(...).then(...);
ykey.claimInterface(0)
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} Uncaught (in promise) DOMException: Unable to claim interface.
I suspect this to be a siimlar issue as with the chrome.usb api. Should I write a udev rule to not use the usbhid driver on that device to make this work?
From an IRC Conversation, Reilly mentioned
The HID driver must not be loaded, so a udev rule is the way to go.
The restriction comes from the OS because when the HID driver is loaded that interface is "claimed" so Chrome can't claim it for itself.