6

I'm trying to use the WebUSB api with Chrome 67. The following code was working a month ago. I'm not sure if something is changed or if I missing something. The error I'm getting now is occurring when I'm trying to claim the interface.

The error messages are as follows: DOMException: The requested interface implements a protected class. and 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);

I can't find any information about the error, any information would be appreciated.

Jon
  • 333
  • 2
  • 8

1 Answers1

4

I announced this change here:

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

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23
  • 3
    So this is interfering with my goal of hooking up a USB device to a Javascript application. Is there a way to turn off this check (eg a hidden browser option or something)? I understand the security concerns but this seems like a heavy-handed solution which makes a bunch of useful things impossible. – mtraven Jun 23 '18 at 21:23
  • I have read the announce, but i'm still not able to solve the problem. What should I do to avoid this error/warning message? Thanks in advance – David Canós Oct 27 '18 at 19:05
  • 1
    @DavidCanós, I know this is very late, but for any other stragglers, the gist is that device is no longer usable with WebUSB on Chromium browsers. – mattliu Nov 19 '19 at 22:31
  • I've just come across this limitation too, it's a shame. My device is an uvc-compliant IR camera that uses the zoom channel to control features. These don't show up as supported settings in mediaDevices and I'd hoped to use WebUSB to control it instead. – StephMW May 03 '21 at 22:01