Skip to content

Commit

Permalink
refactor(client): support more browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Oct 31, 2020
1 parent 79c2ed2 commit ef1bc8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ export function createClient(options: ClientOptions): Client {
} else if (typeof WebSocket !== 'undefined') {
ws = WebSocket;
} else if (typeof global !== 'undefined') {
ws = global.WebSocket;
// @ts-expect-error: Support more browsers
ws = global.WebSocket || global.MozWebSocket;
} else if (typeof window !== 'undefined') {
ws = window.WebSocket;
} else if (typeof self !== 'undefined') {
ws = self.WebSocket;
// @ts-expect-error: Support more browsers
ws = window.WebSocket || window.MozWebSocket;
}
if (!ws) {
throw new Error('WebSocket implementation missing');
Expand Down

0 comments on commit ef1bc8f

Please sign in to comment.