You can Try this, but this will work on Internet Explorer:
<script type="text/javascript">
function GetComputerName()
{
try
{
var network = new ActiveXObject('WScript.Network');
// Show a pop up if it works
alert(network.computerName);
}
catch (e) { }
}
</script>
<html>
<body onload="GetComputerName()"></body>
</html>
hope it helps :)