mdn / browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
4.88k stars 1.96k forks source link

'claimInterface' on 'USBDevice': The requested interface implements a protected class. #23657

Closed itzmeKaali closed 1 month ago

itzmeKaali commented 1 month ago

What type of issue is this?

Other

What information was incorrect, unhelpful, or incomplete?

const device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x072f, productId: 0x2200 }] });

    console.log('Device:', device);
    await device.open();
    await device.selectConfiguration(1);
    await device.claimInterface(0);

    This script returns "Error requesting USB device: DOMException: Failed to execute 'claimInterface' on 'USBDevice': The requested interface implements a protected class." I'm trying to claim data from the SMARTCARD 

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet)

What did you expect to see?

I want to collect the data of the NFC card on the reader

Did you test this? If so, how?

Yes but the same issue

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

No response

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/claimInterface

MDN metadata

MDN page report details * Query: `api.USBDevice.claimInterface` * Report started: 2024-07-04T12:54:01.542Z
queengooborg commented 1 month ago

This sounds like you're requesting development assistance more than reporting a browser issue. A quick internet search reveals a StackOverflow thread about WebUSB and Smart Card readers: https://stackoverflow.com/questions/66420229/webusb-api-and-pc-sc-smart-card-readers

itzmeKaali commented 1 month ago

hi this is not helping me

queengooborg commented 1 month ago

I'm sorry if that thread is unhelpful, but I'm afraid this repository is not for development assistance. This repository is only about browser compatibility and bugs, and your browser is behaving as per the specification (see https://wicg.github.io/webusb/#dom-usbinterface-isprotectedclass-slot for reference). If you need development assistance, I highly recommend searching around or asking on StackOverflow, a dedicated help forum for coding.