Wednesday, May 15, 2024
102
rated 0 times [  107] [ 5]  / answers: 1 / hits: 92766  / 11 Years ago, thu, january 23, 2014, 12:00:00

I need to read the system time from the environment variables on the client's OS. I searched on Stackoverflow and found that this isn't possible. However, those answers were from 2010 and I want to ask if anything has changed since.



Is it possible with some kind of framework? or Javascript is still sandboxed and cut off from OS?


More From » environment-variables

 Answers
43

szpic, if Javascript were not sandboxed from the OS, any half-witted criminal could get onto your computer and take control. Allowing environmental variables is way too low level to ever be allowed.



Take a look at all of your environmental variables and ask yourself if everyone on the planet should have access to all that data about your computer.






If you want to do this with Javascript, you'll have to use a special web browser, such as node-webkit. It isn't going to run on any normal web browser, though, so don't expect more than 0.0001% of the population to expect to run your page.






I don't know your intended use, but one trick, to throw in an environmental variable, is to make a shortcut to your web application, and include it in there as a URL parameter (at least on Winblows).



http://myapp.com?computername=%COMPUTERNAME%

[#72979] Wednesday, January 22, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zachary

Total Points: 175
Total Questions: 89
Total Answers: 108

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;