Skip to content
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

The page appears connected even if HW removed #20

Open
apshu opened this issue Jan 10, 2025 · 1 comment
Open

The page appears connected even if HW removed #20

apshu opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@apshu
Copy link
Collaborator

apshu commented Jan 10, 2025

WEBHID might offer an event when device desconnected

@apshu apshu added the bug Something isn't working label Jan 10, 2025
@apshu apshu added this to the V2.0 milestone Jan 10, 2025
@apshu
Copy link
Collaborator Author

apshu commented Feb 21, 2025

disconnect event is sent to navigator when the USB is disconnected from PC

navigator.hid.addEventListener('disconnect', (event) => {
if (event.device === device) {
alert('HID device removed from USB port');
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant