Skip to content

Commit

Permalink
fix: simplify the check for WebSocket availability
Browse files Browse the repository at this point in the history
This check was added for the flashsocket transport, which has been
deprecated for a while now ([1]). But it fails with latest webpack
versions, as the expression `"__initialize" in WebSocket` gets
evaluated to `true`.

Related:

- #689
- socketio/socket.io-client#1537

[1]: dbc65f3
  • Loading branch information
darrachequesne committed May 2, 2022
1 parent 32878ea commit f158c8e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/transports/websocket.ts
Expand Up @@ -240,9 +240,6 @@ export class WS extends Transport {
* @api public
*/
check() {
return (
!!WebSocket &&
!("__initialize" in WebSocket && this.name === WS.prototype.name)
);
return !!WebSocket;
}
}

0 comments on commit f158c8e

Please sign in to comment.