Xamarin Webview没有在UWP项目中加载这个特定的源url



Xamarin.Forms Webview没有在UWP项目中加载特定的url。如果我在安卓系统上尝试同样的方法,效果很好。。。

XAML:

ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WebViewTest.MainPage">
<StackLayout>
<WebView HeightRequest="600"  WidthRequest="800" x:Name="webView"/>
</StackLayout>
</ContentPage>

代码背后:


using Xamarin.Forms;
namespace WebViewTest
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
webView.Source = @"https://player.twitch.tv/?allowfullscreen=false&autoplay=true&channel=EtcKid&parent=streamernews.example.com";
}
}
}

这个问题大约在两周前首次出现。

我使用Xamarin.Forms:v4.8.0.1364和VisualStudio2019:v16.7.2

有人有什么解决方案吗?

问候和感谢,

Timon

根据Xamarin WebView:

UWP WebView使用Microsoft Edge渲染引擎。桌面和平板电脑设备应该具有与使用Edge相同的性能浏览器本身。

UWP WebView使用的是传统的Microsoft Edge渲染引擎,所以我用Microsoft Edge传统进行了测试,但网站无法在其中打开。这应该是Edge传统的问题。

有WebView2支持Microsoft Edge(Chromium(,但它只在WinUI 3预览版中,尚未集成到稳定的UWP中,有关更多信息,请查看:

https://github.com/MicrosoftEdge/WebViewFeedback/issues/186

https://learn.microsoft.com/en-us/microsoft-edge/webview2/