-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add and remove listeners #22
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Unfortunately this doesn't implement the events properly because it will pass through the USBConnectionEvent objects instead of translating them to their Web Serial API equivalents. As you guessed on #20 I did start working on a patch to implement connection events but unfortunately it's non-trivial to get right because EventTarget doesn't support specifying a custom "get the parent" algorithm. That is tracked by whatwg/dom#583 but we can probably work around it by implementing our own Event interface and dispatching routine. |
Alright, I feared it would not be as easy as I thought. I mean - technically it seems to be working, at least for my use case the disconnect handler is triggered. But I will leave it now up to you to finish your proper solution. |
Hey @reillyeon - just wanted to bump this issue since I am now running into the same issue with a different project and was wondering if there is any chance you made any progress with this? |
I haven't had a chance to look at this. As a workaround your code can add its own listeners for the |
Alright, I will give that a try, thank you. |
Resolves #20