2
新しいChrome WebUSB APIを試していますが、接続されているデバイスは表示されません。Chrome WebUSB APIはnavigator.usb.getDevices()を使用しているときにデバイスを返しません。
<html>
<body>
<button onclick="myFunction()">Click me</button>
<script>
function myFunction() {
console.log('Clicked');
navigator.usb.getDevices()
.then(devices => {
devices.map(device => {
console.log('Device:');
console.log(device.productName);
console.log(device.manufacturerName);
});
});
}
</script>
</body>
</html>
しかし、誰デバイスを持っていない:
は私のWindows 7 PCに接続されている別のUSBデバイスと、例えばこれを試してみました。
私は間違っていますか? どのデバイスでも使用できますか?
ありがとうございました。