The App Container and Win8Apps written in JavaScript

Posted on 4/19/2013 @ 9:43 PM in #Vanilla .NET by | Feedback | 1426 views

A win8 app can be nothing more than a bunch of html/css/js files etc. So what executes them? The answer , a process called wwahost.exe, also known as the App Host. The App Host is basically IE10 minus all the chrome, with a few big differences,

  • Many JavaScript APIs are not available or are modified. For instance, instead of window.alert, use Windows.UI.Popups.MessageDialog. You can find the differences detailed here and here.
  • There are some additional methods and CSS media queries specific to Win8 apps to support Win8 view states.
  • The default page of the app runs in the local context where it can access WinRT and can make cross-domain XmlHttpRequests, or download blobs off the internet. What it cannot do, is download external JavaScript, or change the DOM (i.e. you can’t use document.write and innerHTML properties)
  • IFRAMEs however are allowed, but they cannot use WinRT or cross-domain XHR. WinJS is however available, so you can use all the UI Glitz.

What is interesting to note is that Win8 apps can access some Win32 apis whereas JS apps are limited to only WinRT. However, you can write WinRT components and use them in a JavaScript environment.

Sound off but keep it civil:

Older comments..