How to prevent a new window from being opened in geckofx?

I can't find a way to prevent a new window from being opened when clicking links on a webpage. All pop-up settings don't work.

I want to open any clicked links in the current window. How can i do this?


source to share

1 answer

You can use the CreateWindow event to handle the new popup:

GeckoWebBrowser wb1 = new GeckoWebBrowser();
wb1.CreateWindow += new EventHandler<GeckoCreateWindowEventArgs>(wb1_CreateWindow);


Here's the CreateWindow event:

void wb1_CreateWindow(object sender, GeckoCreateWindowEventArgs e)
    //Keep popup new window here!
    e.Cancel = true;


    // OR

    //GeckoWebBrowser wb1 = new GeckoWebBrowser();
    //wb1.Navigating += new EventHandler<GeckoNavigatingEventArgs>(wb1_Navigating);
    //wb1.Dock = DockStyle.Fill;
    //TabPage tab1 = new TabPage("New WebBrowser");




All Articles