In My UWP project, I am using a Javascript to get the os-sku value,
MainWindows.xaml.cs:
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            //Load local html file using 'Navigate' method    
            WebBrowserName.Navigate(new Uri("ms-appx-web:///HTMLPage1.html"));
            }
        async void WebBrowserName_ScriptNotify(object sender, NotifyEventArgs e)
        {
            if (e.Value.StartsWith("SomeValue"))
            {
                Windows.UI.Popups.MessageDialog dialog = new Windows.UI.Popups.MessageDialog("Calling javascript function from C#");
                await dialog.ShowAsync();   
            }
        }
        private  void Button1_Click(object sender, RoutedEventArgs e)
        {
                        WebBrowserName.InvokeScriptAsync("JSMethod", new string[] { "" });
        }
    }
and HTMLPage1.html:
<html>
<head>
    <script type="text/javaScript">
        function JSMethod() {
           external.getHostEnvironmentValue('os-sku'); //Exception Occured
        }
    </script>
</head>
<body>
    "OSSKU :
    <p id="demo">
        <script></script>
    </p>
</body>
</html>
After deploying the UWP app and while running the above app, I am getting an, Exception :
UWP 0x800a01b6 - javascript runtime error: object doesn't support property or method 'gethostenvironmentvalue'
I am not able to figure it out, what is going wrong.
As the getHostEnvironmentValue method introduction, this method is only available in Microsoft Edge. Even througn web view control embeds a view into your uwp app that renders web content using the Microsoft Edge rendering engine, but the UWP WebView is different from the Edge, moreover, the UWP apps run sandboxed, it has more security and resource access limitations. So, as the exception, this getHostEnvironmentValue method can not be used in UWP app, it is not supported.
 Breeze Liu - MSFT • edited Jun 19, 2018 by
 Breeze Liu - MSFT • edited Jun 19, 2018 by  Breeze Liu - MSFT
 Breeze Liu - MSFTUser contributions licensed under CC BY-SA 3.0