The websocket resolution logic here attempts to resolve WebSocket on global and window before defaulting to the Node ws implementation.
This turns out to be non-exhaustive, since there is a WebSocket built-in in the extension env (i.e. just WebSocket or self.WebSocket) but no window which it would normally resolve to in a browser env.
Context
global
andwindow
before defaulting to the Nodews
implementation.WebSocket
orself.WebSocket
) but nowindow
which it would normally resolve to in a browser env.