i can't find way to denied open new window when clicking links on webpage. All preferences about popups is not working.
I want to open any clicked links in current window. How can i do that?
You can use the event CreateWindow to handle a new popup window:
GeckoWebBrowser wb1 = new GeckoWebBrowser();
wb1.CreateWindow += new EventHandler<GeckoCreateWindowEventArgs>(wb1_CreateWindow);
Here event CreateWindow:
void wb1_CreateWindow(object sender, GeckoCreateWindowEventArgs e)
{
//Keep popup new window here!
e.Cancel = true;
//e.WebBrowser.Navigate(e.Uri);
// OR
//GeckoWebBrowser wb1 = new GeckoWebBrowser();
//wb1.Navigating += new EventHandler<GeckoNavigatingEventArgs>(wb1_Navigating);
//wb1.Dock = DockStyle.Fill;
//wb1.CreateControl();
//TabPage tab1 = new TabPage("New WebBrowser");
//tabBrowser.TabPages.Add(tab1);
//tab1.Controls.Add(wb1);
//wb1.Navigate(e.Uri);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With