Say, I am clicking on some tennis match on Flashscore web site. A new window pops up. I want to capture that second window in WebView2:
browser.CoreWebView2Ready += delegate
{
browser.CoreWebView2.NewWindowRequested += OnNewWindowRequested;
};
private async void OnNewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
{
var newWindow = e.NewWindow; //null
}
However, newWindow
is null
. At the same time, using WindowFeatures
, I can get height or width of the new window:
uint height = e.WindowFeatures.Height;
uint width = e.WindowFeatures.Width;
How can I capture the reference to the second window?