Closed as not planned
Description
What is the problem this feature will solve?
This sounds like a simple feature request. We already got EventTarget
and Event
. So my feature request is to have a globalThis.addEventListener
. (along with remove & dispatch) added to the global scope (by extending EventTarget)
What is the feature you are proposing to solve the problem?
Deno, browser and web workers and even cloudflare workers already has a global event listener that can be used to listen to a variety of things.
It can be used for listening to eg PostMessage, network offline/online, background fetch, any kind of errors etc.
This is partly related to #43583
Having different code paths to solve the same things gets troublesome.
What alternatives have you considered?
No response