This does the trick on Windows:
function getUser() {
return Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get('USERNAME');
}
More Related Contents:
- Accessing Variables from Greasemonkey to Page & vice versa
- What do {curly braces} around javascript variable name mean [duplicate]
- How to use jQuery in Firefox Extension
- How can I disable signature checking for Firefox add-ons?
- Open a new tab/window and write something to it?
- .setAttribute(“disabled”, false); changes editable attribute to false
- What is this JavaScript syntax: {Ci, CC}? [duplicate]
- How I can make a browser action button that looks and acts like a toggle
- Can you get a list of Firefox add-ons programmatically
- TypeError: [API] is undefined in content script or Why can’t I do this in a content script?
- How can my Add-on SDK content script interact with a website page script?
- Handling connection loss with websockets
- Get selected text and selected nodes on a page?
- Controlling a Firefox Extension via Javascript
- Firefox Add-On window.navigator.userAgent error: window not defined
- Add-on “appears to be corrupt” when trying to install my add-on’s .xpi file in Firefox
- Firefox WebExtension importing Services
- jQuery in Greasemonkey 1.0 conflicts with websites using jQuery
- My very simple Greasemonkey script is not running?
- JavaScript getter for all properties
- Accessing the content of other tabs in a browser
- Open IE browser in Firefox/Chrome page
- “not well-formed” error in Firefox when loading JSON file with XMLHttpRequest
- jQuery 1.10.2 warning issue from Firefox
- event.target on Firefox
- Proper way to detect WebGL support?
- onKeyPress event in Firefox and IE8
- window.event alternative in Firefox
- Error: “Access to restricted URI denied”
- css transitions on new elements