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

>From the [OP](https://github.com/w3c/ServiceWorker/issues/718#issue-92573396),

> To reduce this a bit, I've been looking into a) detecting Service Workers without fetch event handlers, and b) immediately falling back to the network. Unfortunately, as things stand today, fetch event handlers can be registered at any point, making (a) rather difficult.

The problem we solve is detecting whether the service worker doesn't serve the event type when dispatching a functional event. I think we had relied on the first evaluation time because we thought tracking the state would be difficult. But on reflection, I think we can do that by inserting/removing the event type to/from the set when the `addEventListener()` and `removeEventListener()` are called from any tasks. Are there any reasons this wouldn't work?

-- 
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-374169142

Received on Monday, 19 March 2018 10:40:03 UTC