Reputation: 833
Hi I am trying to open a webpage and display it's contents within a UWP Webview.
I am presuming that I doing something wrong as the topic is quite new to me.
My main routine:
WebViewSettings webSettings = WebviewControll.Settings;
webSettings.IsJavaScriptEnabled = true;
WebviewControll.Navigate(new Uri("https://threejs.org/examples/webgl_geometry_cube.html", UriKind.Absolute));
saw some comments about enabling with my Package.appxmanifest:
<uap:ApplicationContentUriRules>
<uap:Rule Match="ms-appx-web:///Web/App.html" WindowsRuntimeAccess="all" Type="include"/>
</uap:ApplicationContentUriRules>
</Application>
my XAML:
<Grid>
<WebView x:Name="WebviewControll" Height="auto" Width="auto" >
</WebView>
</Grid>
expected Result:
Upvotes: 0
Views: 597
Reputation: 8666
Please take a look at the new WebView2 control. Use the WebView2
control instead of the old WebView
control. Using the WebView2
control, I could see the html page is shown correctly.
To use the WebView2
in your UWP app, you will need to install the Microsoft.Web.WebView2 and Microsoft.UI.Xaml-2.8 NuGet package.
Use it like the old WebView:
<control:WebView2 x:Name="wv2" Source="https://threejs.org/examples/webgl_geometry_cube.html"/>
For more information, please check this document:Get started with WebView2 in WinUI 2 (UWP) apps (public preview)
Upvotes: 1