CoreWebView2.NewWindowRequested Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
NewWindowRequested is raised when content inside the WebView requests to open a new window, such as through window.open().
public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2NewWindowRequestedEventArgs> NewWindowRequested;
member this.NewWindowRequested : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2NewWindowRequestedEventArgs>
Public Custom Event NewWindowRequested As EventHandler(Of CoreWebView2NewWindowRequestedEventArgs)
Event Type
Remarks
The app passes a target WebView that is considered the opened window. If a deferral is not taken on the event args, scripts that resulted in the new window that are requested are blocked until the event handler returns. If a deferral is taken, then scripts are blocked until the deferral is completed.