I'm trying the new Chrome WebUSB API, but can't see any connected device.
Tried this for example, with different USB devices connected to my Windows 7 PC:
<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>
But got no device.
What am I doing wrong? Should it work with any device?