Retrieve Windows Username with JavaScript
I need to retrieve the username from the computer of the person that visits a webpage. This is for an internal company thing. Right now we have a VB script that does this through an ActiveX function. Is there a way to do it with JavaScript and not using ActiveX so that Firefox will be able to do it.
Any help is appreciated.
Thanks
Bryce
# 1 Re: Retrieve Windows Username with JavaScript
JavaScript itself cannot get the username.
You have to stick to ActiveX. Part of the reason behind this is a security risk. ActiveX is known for bad security. For that reason Firefox (as well as many other browsers) does not support it. To get the username through just JavaScript would be a security risk as well. Therefore it would be along the same lines as ActiveX.
# 2 Re: Retrieve Windows Username with JavaScript
Is there anyway at all to retrieve the user's login name through Firefox? Or would anything like that have to be strictly done with ActiveX? Can I retrieve the processes and then grab the name associated with the creation of the process??
If I am confined to making this an IE only site please just tell me so that I can move on...haha. I love Mozilla, that's why I want this to work for Mozilla. But if it can't then that's the nature of it.
Thanks a ton.
Bryce
# 3 Re: Retrieve Windows Username with JavaScript
If the username were stored in a cookie, a javascript could read it.
That cookie could be created with a logon screen.
That cookie could be created by a little program running every time a Windows session starts, or running the first time a user is allowed to access your intranet. A cookie is nothing else but a little file placed in a special folder. This file may have rights preventing it from being accidentally removed.
# 4 Re: Retrieve Windows Username with JavaScript
Either, I am confused or olivthill is. Are you attempting to get the current user logged into Windows or a person logged into your website? If it is Windows, then you are stuck to IE only.