10

Could you please tell me, if it's possible to read Environment Variables using Javascript from a page running on Firefox.

4
  • Do you mean operating systems environment variables? Commented Sep 22, 2010 at 14:50
  • @Gunner you know any other? :) Commented Sep 22, 2010 at 14:53
  • @Andrey: Well I know it means OS ones. I was wondering if the original poster was talking about settings of the browser and calling that environment variables. Commented Sep 22, 2010 at 17:42
  • This question is answered in this post: stackoverflow.com/questions/399263/… Commented Apr 3, 2012 at 11:56

2 Answers 2

6

No. JavaScript is sandboxed to prevent this sort of thing.

Sign up to request clarification or add additional context in comments.

Comments

4

Short answer: No.

Long answer: Maybe. If you mean system environment variables, there isn't (that I'm aware of) any way to do that via straight JavaScript. You can access a number of system information through JavaScript though. Check this page out for some examples:

http://www.docsteve.com/DocSteve/Samples/JS/javascript_env.html

This shows how to get the underlying OS/platform, Depending on exactly what you're looking for, this may not work. It's possible via other methods, like creating an ActiveX object and using that. However, this requires additional steps on the user end (like installing/authorizing ActiveX).

I think this is a security feature, separating the system from the browser, therefore it can be difficult (or impossible, depending on your requirements).

2 Comments

Thanks for the help Josh. @Bears will eat you, you are right FF doenst support ActiveX, so I am out of luck here I guess
While FF doesn't natively support ActiveX, I've personally used ActiveX within FF before via an add-on. This was a while ago, 1.x, so maybe newer FF versions removed that capability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.