IWebViewControl.NewWindowRequested Event


Occurs when a user performs an action in the IWebViewControl that causes content to be opened in a new window.

// Register
event_token NewWindowRequested(TypedEventHandler<IWebViewControl, WebViewControlNewWindowRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void NewWindowRequested(event_token const* cookie) const;

// Revoke with event_revoker
IWebViewControl::NewWindowRequested_revoker NewWindowRequested(auto_revoke_t, TypedEventHandler<IWebViewControl, WebViewControlNewWindowRequestedEventArgs const&> const& handler) const;
event TypedEventHandler<IWebViewControl,WebViewControlNewWindowRequestedEventArgs> NewWindowRequested;
function onNewWindowRequested(eventArgs) { /* Your code */ }
iWebViewControl.addEventListener("newwindowrequested", onNewWindowRequested);
iWebViewControl.removeEventListener("newwindowrequested", onNewWindowRequested);
- or -
iWebViewControl.onnewwindowrequested = onNewWindowRequested;
Event NewWindowRequested As TypedEventHandler(Of IWebViewControl, WebViewControlNewWindowRequestedEventArgs) 

Event Type


This event occurs only for user initiated actions. By default, when a user clicks a link in a IWebViewControl that requests to open in a new window, the link launches the default browser. A new window can be caused by the user clicking on an href, or a button which calls window.open.

Handle this event to provide custom handling of the new window request. You might navigate the IWebViewControl to the desired page, or create a new IWebViewControl in your app to display the requested content. If you provide custom handling of the new window request, set the Handled property to true to prevent the default browser from being launched.

Applies to