I'm a bit disappointed by the lack of trying to at least give me a partial solution.
Although I wasn't able to find a browser-independent solution, I came up with one for IE on Windows, using WMI, more precisely the WbemScripting.SWbemLocator
ActiveX Object. It's better than nothing, better than "you can't do that".
So, for anyone else interested, here it is:
function pollConnectedDevices()
{
var locator = new ActiveXObject("WbemScripting.SWbemLocator");
var conn = locator.ConnectServer(".", "root\\cimv2");
var result = conn.ExecQuery("Select * From Win32_USBHub");
var enumer = new Enumerator(result);
for (;!enumer.atEnd();enumer.moveNext ())
{
var hub = enumer.item ();
alert(hub.Name + " " + hub.DeviceId);
}
setTimeout("pollConnectedDevices()",1000);
}
setTimeout("pollConnectedDevices()",1000);
Yes, it is only on IE on Windows. Yes, it does need the user's permission to do its thing. But, YES, it is something, it is possible, it does what I need it to do.
If anyone else knows another way - and I'm talking here about code, not opinions, I'm still looking for partial solutions for other browsers and OSes. USB device querying is an interesting thing to have and in spite of all the arguments, I say that "it's software, it's supposed to do something, not prevent you from doing something".