[This documentation is preliminary and is subject to change.]
Learn about the features available to pages in the local and web contexts.
A Metro style app using JavaScript contains at least one HTML page. That page, and any other pages you include in the app itself, generally run in the app's local context. When you use an iframe to navigate to a remote page, that page runs in the web context and has limited access to your system.
You can use the ApplicationContentUriRules section of the app's package manifest to give a page in the web context access to your system's geolocation devices (if your app has permission to access this functionality), as well as access to the clipboard and the ability to download files.
General features and restrictions
This table describes some of the features and restrictions that are available depending on whether the page is running in the local or web context.
| Feature | Local context | Web context |
|---|---|---|
| Windows Runtime | Yes | No |
| Windows Library for JavaScript | Yes | Yes* (See the Windows Library for JavaScript in the web context section for details.) |
| JavaScript URIs (attribute | No A URI can refer to defined JavaScript functions ( | Yes |
| External script references (<script src="http://*" /> ) | No Script must come from locally packaged content. | Yes |
| window.close | Yes | No |
| Cross-domain XHR requests | Yes | No |
Windows Library for JavaScript in the web context
Although you can use Windows Library for JavaScript in the web context, some of its APIs work differently because the web context does not have access the Windows Runtime. Here are some of the APIs that are affected:
| API | Behavior changes in the web context |
|---|---|
| WinJS.UI.AppBar |
|
| WinJS.UI.ListView |
|
| WinJS.UI.Rating |
|
| WinJS.UI.SettingsFlyout |
|
| WinJS.UI.StorageDataSource |
|
| WinJS.UI.ToggleSwitch |
|
| WinJS.UI.Tooltip |
|
Build date: 5/22/2012
