Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make isWebSocket check more lenient to support iOS Safari #107

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

pxpeterxu
Copy link
Contributor

On older iOS Safari, typeof WebSocket will return object instead of function: (screenshot from Chrome attached to iOS Safari remote debugger)

image

As a result, we get the following error:

VMundefined:1846 Error: No valid WebSocket class provided

This PR makes the check more lenient; it makes the typeof check just make sure it exists. The w.CLOSING check should still provide enough safety for us.

I've also added tests for this

- On older iOS Safari, `typeof WebSocket` will return `object` instead of function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants