【发布时间】:2018-10-09 19:50:31
【问题描述】:
所以我想在我的网站上使用闪存驱动器作为 2FA 的一个选项(使用设备序列号)。我正在使用 WebUSB,但闪存驱动器不会显示在设备选择窗口中。我已经看到网络 USB 无法读取/写入文件,所以 它甚至可以看到闪存驱动器吗?
如果有帮助,这是我的代码:
console.log("test");
usbLookup.addEventListener('click', function() {
navigator.usb.requestDevice({ filters: [{ }] })
.then(device => {
console.log(device.serialNumber);
})
.catch(error => { console.log(error); });
});
<iframe allowpaymentrequest allow='usb'></iframe>
<a id="usbLookup">Get Serial</a>
【问题讨论】:
标签: webusb