I am working a Firefox add-on (which is written in JavaScript) and need to determine the Windows user currently logged on. Is there a way to do this?
Following code works for me instead of onload event with function calling:
var objUserInfo = new ActiveXObject("WScript.network");
document.write(objUserInfo.ComputerName+"
");
document.write(objUserInfo.UserDomain+"
");
document.write(objUserInfo.UserName+"
");
var uname = objUserInfo.UserName;
alert(uname);