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

Feature detect WebSockets in older clients #43

Merged
merged 1 commit into from
Feb 24, 2015
Merged

Feature detect WebSockets in older clients #43

merged 1 commit into from
Feb 24, 2015

Conversation

josh
Copy link
Contributor

@josh josh commented Feb 24, 2015

It'd be nice to be able to load this script in older clients that don't support WebSockets like IE9.

I think it makes sense to just leave ReconnectingWebSocket undefined so you can feature check it in the same way.

So if you're code was

if ('WebSocket' in window) {
  var ws = new WebSocket('ws://....');
}

You can just change that to

if ('ReconnectingWebSocket' in window) {
  var ws = new ReconnectingWebSocket('ws://....');
}

/cc @joewalnes @mislav

@mislav
Copy link

mislav commented Feb 24, 2015

👍

joewalnes added a commit that referenced this pull request Feb 24, 2015
Feature detect WebSockets in older clients
@joewalnes joewalnes merged commit 9f6f147 into joewalnes:master Feb 24, 2015
@joewalnes
Copy link
Owner

Agree. Merged. Thanks.

@josh
Copy link
Contributor Author

josh commented Feb 25, 2015

@joewalnes thanks!

@josh josh deleted the feature-check-ws branch February 25, 2015 16:36
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.

None yet

3 participants