How does one detect that the environment is Windows 8 Metro application from Javascript?
UPDATE: To clarify, my Javascript code runs both on any browser and as part of an Win8 application. Since Win8 applications impose security restrictions for JS code, I want to detect when the code is running in Win8 app.
Answering myself:
One way to detect this is to check the existence of some MS-specific objects or namespaces. One of them is Windows. For example: