Re: [whatwg/dom] Nerfing all events on all event targets in a serviceworker after initial script evaluation seems odd (#371)

> 2. Can we remove the exception at this point.
> 3. Should we limit this practice somehow. E.g., require an opt-in other than an event listener for new "functional events".

I've thought about this. I don't think we can avoid throwing here. Functional events themselves are the very starting point of the execution of service workers, and the existence of the event listeners being the criterion for the optimization sounds reasonable to me. I think we should do this for all the functional events. For custom events, they can't start off a service worker in the first place, but we can just let them work as usual within the lifetime of a service worker.

 We'd still have to change it to allow only `ServiceWorkerGlobalScope` as the event target though (instead of all the event target objects in the global).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/371#issuecomment-377472366

Received on Friday, 30 March 2018 08:04:01 UTC