-
Notifications
You must be signed in to change notification settings - Fork 313
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
Capture the hasListener
consensus
#225
Comments
Can you just say "when a listener is registered for an X event, record that the SW is listening to X events", and only update that record during install/update callbacks? |
@tabatkins That involves wrapping |
Not everyone is happy about doing this: http://krijnhoetmer.nl/irc-logs/whatwg/20140409#l-34 It seems @Hixie and @tabatkins are talking a little bit past each other there. I'm pretty sure @Hixie is only ok with overloading |
I'd also like to avoid overriding |
@slightlyoff @jakearchibald this needs-spec issue hasn't been updated in a while and a quick read of the spec didn't reveal anything relevant. Is this issue still current? |
#445 has a different approach to this. |
Thanks, let's see how the discussion spans out on #445 |
As per today's f2f discussion at Mozilla, we've decided on filtering event dispatch for the life of an active handler based on the list of event handlers which are registered in the SW global.
E.g., a SW without an
onfetch
handler will never ever be sent afetch
event:The exact spec language will need to look at the list of registered handlers as the very first microtask-end task during the initial evaluation of the SW script. Subsequent boot-ups of the SW will only be triggered by the list of events captured as a result of that first eval. Updates (new
oninstall
chances) are the only time the list of event handlers will be re-litigated. E.g., the list of events you register for is fixed per-version by the events you register at the top-level the very first time.The text was updated successfully, but these errors were encountered: