0

I am trying to access environment variables through the browser with Dart/Dartium. I know I can't use the 'io' library. I thought I might be able to use the 'html' library based on some other posts I found, but I haven't figured it out. There is a similarly named "Platform" class in both libraries, but the version in 'html' is different and does not have an "environment" property.

Thanks.

Sam B
  • 187
  • 12

1 Answers1

0

JavaScript does not have this kind of access to the user's OS through the browser. As Dart gets compiled to JS in order to run in the browser, that means Dart shares that exact limitation.

So no, unfortunately you cannot access environment variables by using the dart:html library.

You may also find this question helpful: Javascript environment variables

Community
  • 1
  • 1
stwupton
  • 2,177
  • 17
  • 18
  • This is not a Javascript or Dart limitation, but rather a deliberate feature of web browsers to shield the underlying system from any code that may be downloaded with a web page. Additionally, web developers do not need to know what type of system the browser is running on, they just know they are running in a common (for the most part) web browser environment. – Argenti Apparatus Dec 18 '15 at 01:02