Created
November 22, 2010 20:00
-
-
Save infynyxx/710561 to your computer and use it in GitHub Desktop.
Connection Detection for Webkit Browsers http://infynyxx.com/connection_detection.html
This file contains hidden or 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
<html> | |
<head> | |
<title>Wifi Detection</title> | |
<script> | |
//http://infynyxx.com/misc/connection_detection.html | |
window.onload = function() { | |
if (navigator.connection) { | |
var connection_mapper = {}, conn = navigator.connection; | |
connection_mapper[conn.UNKNOWN] = "Unknown Connection"; | |
connection_mapper[conn.CELL_2G] = "2G connection"; | |
connection_mapper[conn.CELL_3G] = "3G Connection"; | |
connection_mapper[conn.WIFI] = "WIFI Connection"; | |
connection_mapper[conn.ETHERNET] = "Ethernet Connection"; | |
alert(connection_mapper[conn.type]); | |
} | |
} | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment