WebUSB API protected interface class error
Asked Answered
D

1

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.

Danu answered 29/5, 2018 at 19:55 Comment(0)
T
4

I announced this change here:

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

Trimly answered 30/5, 2018 at 14:44 Comment(5)
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.Breaking
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 advanceMisha
@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.Tubercular
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.Marmite
So there is no way to use NFC readers on web apps?Buck

© 2022 - 2024 — McMap. All rights reserved.