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

Chromium implemented this for fetch event:
 - The variable checking the fetch handler existence: https://cs.chromium.org/chromium/src/content/browser/service_worker/service_worker_version.h?type=cs&sq=package:chromium&l=731
 - Checking _has ever been evaluated flag_ in `addEventListener` code: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp?type=cs&sq=package:chromium&l=245

> We record their event names as being able to start the service worker

Do you mean making the UA start the service worker to dispatch the recorded **random** custom events? Allowing scripts to control the service worker lifecycle seems like a performance issue.

> I think we should probably also only do this for some of the existing event names

If you meant we just confine the allowed custom event names to only the functional events, there might be some ways we could think about. But I think it'll be difficult to record event names in all the async tasks (e.g. promise callbacks, etc).

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

Received on Friday, 16 March 2018 10:22:29 UTC