How to disable open page in new window? I want to open a new page in self
Closing as this is a duplicate. See #600
As the api has changed since the last answer has been posted, here's how to acheive that
Implement ILifeSpanHandler
in a new class.
With the following implementation of OnBeforePopup
public bool OnBeforePopup(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
browser.MainFrame.LoadUrl(targetUrl);
newBrowser = null;
return true;
}
Then instantiate your implementation and set the LifeSpanHandler
property of your browser with it.
Most helpful comment
As the api has changed since the last answer has been posted, here's how to acheive that
Implement
ILifeSpanHandler
in a new class.With the following implementation of
OnBeforePopup
Then instantiate your implementation and set the
LifeSpanHandler
property of your browser with it.