I don't see a way to register a callback when a connection is lost in the chrome.hid API. E.g. an onConnectionLost
method.
How am I supposed to detect a user accidentally pulling the cable in the middle of a process? Are we expected to poll, somehow?
You should star this issue: https://code.google.com/p/chromium/issues/detail?id=349473. When it's implemented you'll be able to do what you want.