javascriptgoogle-chromewebusbwebhid

WebHID API: reconnect device


Is it possible to "silently"(without calling navigator.hid.requestDevice) reconnect hid device after it was disconnected and connected with USB cable again?

navigator.hid.getDevices is not an option, it doesn't return device after it was disconnected.


Solution

  • Assuming that the device has a serial number so that the browser can recognize it when it reconnects and match it against the permission previously granted by the user then it should be returned by navigator.hid.getDevices().

    There is an open Chromium issue tracking a potential regression in this behavior. Please CC yourself on that issue to track the fix.