Trying to read USB Barcode Scanner on MacOS 10.14.1
in Google Chrome Version 71.0.3578.98
via WebUSB.
Using a barcode scanner: https://www.ebay.co.uk/itm/Barcode-Scanner-USB-Handheld-Wired-Portable-Laser-Scan-Bar-Code-Reader-Scan-POS/282865082953
Device is visible in the requestDevice dialog as Usb211
and opens successfully, code I used for this here:
const VENDOR_ID = 0x8888
navigator.usb.requestDevice({ filters: [{ vendorId: VENDOR_ID }] })
.then(selectedDevice => {
device = selectedDevice;
return device.open();
})
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(device.configuration.interfaces[0].interfaceNumber)) # interfaceNumber is 0
.catch(error => { console.log(error); });
When I tried to claimInterface(0)
(which is the only interface available in the device
object, it fails with the error An attempt to claim a USB device interface has been blocked because it implements a protected interface class.
(or SecurityError
DOMException The requested interface implements a protected class.
) - this one is expected because of the recent changes: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/LZXocaeCwDw/GLfAffGLAAAJ
Is there any way to "debug deeper" somehow because I cannot see a way to use only available interface.
Thank you!