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?
This does the trick on Windows:
function getUser() { return Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get('USERNAME'); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With