-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simpler than a serial number or permanent unique identifier: session-specific device identifier #90
Comments
Unfortunately from an implementation perspective scoping this feature request down to a session-specific device identifier that survives the device being reconnected doesn't make the problem any simpler than creating an identifier that is persistent between sessions. Today, if the device isn't disconnected then |
For any device with a serial number, this is easily available on all platforms that I know of. Which platform is this challenging on? In my C# library "HIDSharp" I provide a persistent identifier "DevicePath". Obviously one would not expose the actual value to the web, but for the common platforms anyway: Windows: the device path Let me know if there are any details I can provide that would be helpful. (As an aside, the reason I mention this separate from 'persistent between sessions' is that this case is substantially less of a security concern. But for things like firmware updates it is important.) |
It's hiding the actual value of "DevicePath" (or a similar property) that is challenging. We already have this data within the browser on all platforms. My point in the previous comment was that making the identifier session scoped is not much easier than making is persistent as most of the same corner cases still apply. This is on our project backlog so I just ask for your patience. @nondebug, can you close this as a duplicate of #7 (and give me issue management permissions on this repo). |
Would it at least be possible to provide a unique session id per device that does not survive a disconnect event? Anything at this point would be welcome. |
This is already possible as |
If a permanent unique identifier is not on the cards any time soon for WebHID, it would be helpful at least to have a session-specific device identifier, which would be destroyed upon closing the tab.
Reason being, right now, I set a user property to keep track of the same device between getDevices() and requestDevice(). This works, so that I don't try to connect to the same device twice. However, if the user disconnects and reconnects the device, I do have access in getDevices(), but because it has recreated the device, I lose my tracking property.
The end result of this is, if the device drops off and comes back, I can't tell from getDevices() that it's the same device. I need this, because upon uploading settings in my program, I reboot the device so that its interface goes back to its main menu.
This would be very helpful. If long-lasting tabs are a concern, on a disconnected device the identifier could be destroyed after a timeout.
Thanks!
James
The text was updated successfully, but these errors were encountered: