websockets.js 865 B

123456789101112131415161718192021222324252627282930313233
  1. /*!
  2. {
  3. "name": "WebSockets Support",
  4. "property": "websockets",
  5. "authors": ["Phread (@fearphage)", "Mike Sherov (@mikesherov)", "Burak Yigit Kaya (@BYK)"],
  6. "caniuse": "websockets",
  7. "tags": ["html5"],
  8. "warnings": [
  9. "This test will reject any old version of WebSockets even if it is not prefixed such as in Safari 5.1"
  10. ],
  11. "notes": [{
  12. "name": "CLOSING State and Spec",
  13. "href": "https://www.w3.org/TR/websockets/#the-websocket-interface"
  14. }],
  15. "polyfills": [
  16. "sockjs",
  17. "socketio",
  18. "kaazing-websocket-gateway",
  19. "websocketjs",
  20. "atmosphere",
  21. "graceful-websocket",
  22. "portal",
  23. "datachannel"
  24. ]
  25. }
  26. !*/
  27. define(['Modernizr'], function(Modernizr) {
  28. var supports = false;
  29. try {
  30. supports = 'WebSocket' in window && window.WebSocket.CLOSING === 2;
  31. } catch (e) {}
  32. Modernizr.addTest('websockets', supports);
  33. });