请求的接口实现了一个受保护的类

问题描述 投票:0回答:0

我想通过浏览器使用读卡器

ACR1252
读取NFC卡的数据。浏览器成功看到读卡器,但是不允许我访问接口实现扫描NFC卡授权 这是我的代码

async function requestUSB() {
  const filters = [
    { vendorId: 0x072f, productId: 0x223b }
  ];

  try {
    const device = await navigator.usb.requestDevice({ filters: filters });
    console.log('Device found:', device);

    // Open the device
    await device.open();
    console.log('Device opened:', device)

    // Claim the interface for communication
    await device.claimInterface(1);
    console.log('Interface claimed');

我收到这个错误:请求的接口实现了一个受保护的类。

我知道使用

WebUSB
由于安全原因无法访问被阻止的界面。但是还有其他方法可以使用 JavaScript 从 NFC 卡中获取数据到浏览器吗?有什么 API 的建议吗?

javascript nfc webusb
© www.soinside.com 2019 - 2024. All rights reserved.