In Xul, How To Retrieve An Environment Variable?
I have an environment called $REP, how can I access the value of this variable using Xulrunner in a Linux environment? --udpate attempting with nslEnvironment: var env = Components
Solution 1:
Use nsIEnvironment to read (and set) environment variables.
Solution 2:
Have a look at Setting an environment variable in javascript (which you happened to edit, randomly!).
I very much doubt you'll be able to read these variables from a browser environment though.
edit:
var oShell = WScript.CreateObject("WScript.Shell");
var oSysEnv = oShell.Environment("SYSTEM");
WScript.Echo (oSysEnv("PATH"));
perhaps?
Post a Comment for "In Xul, How To Retrieve An Environment Variable?"