-
Notifications
You must be signed in to change notification settings - Fork 312
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 client "close" event #868
Comments
We should consider this feature. In the mean time, performing GC like this when you see navigation fetches works pretty well |
It would need to be slightly different from "close". Currently the spec controls windows, not documents. So a client can be closed, but also just navigated to a non-controlled document. In that case the client still exists, but is no longer a controlling client. Perhaps we could add events to Client for transition controlled vs non-controlled state. |
Also |
#886 seems to have more detail |
If a SW wants to map a
clientId
to some state, there's no good way to know when to remove the map key. Adding an event that is fired when a client is closed would make this simpler.Note you can't use a
WeakMap
, sinceclients.get()
returns a different Client object every time even for the sameclientId
, so the same client gets added as new keys every time (which IMO is a nasty gotcha).The text was updated successfully, but these errors were encountered: