You can interact with the Windows Runtime API from your JavaScript code when the hosted content is app is running as app on Windows 10.
How to Enable Windows Runtime access from JavaScript in the Windows 10 Hosted Web App ?
You need to set the WindowsRuntimeAccess property in the Included ApplicationContentUriRules element of the app package manifest file.
<uap:ApplicationContentUriRules> <uap:Rule Type="include" WindowsRuntimeAccess="all" Match="http://developerpublish.com/" /> </uap:ApplicationContentUriRules>