Created
November 21, 2013 19:28
-
-
Save mkuklis/7587994 to your computer and use it in GitHub Desktop.
KitKat test for WebSocket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasWebSocket() { | |
var m = navigator.userAgent.match(/Android ([0-9]+)\.([0-9]+)/i); | |
if (m) { | |
var x = parseInt(m[1], 10); | |
var y = parseInt(m[2], 10); | |
return window.WebSocket && (x > 4 || (x == 4 && y >= 4)); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment