I\'m having issues grasping how exactly to handle threads when using GeckoFX- it seems to throw errors constantly when trying to use the GeckoWebBrowser in other threads.
<GeckoFx can only be called from the same thread on which it was initialized (normally the UI thread)
so if you want to call GeckoFx Control, the method must come from the thread which initialized the GeckoFx Control,usually its UI thread as in your case.
you can use BeginInvoke
in Form
class, try like this:
this.BeginInvoke(new Action(() =>
{
browser.Navigate(txtUrl.Text);
//your code
}));
This will solve your prob, put it at the end of your nav request:
myGeckoFxBrowser.Navigate("about:blank");
myGeckoFxBrowser.Document.Cookie = "";
myGeckoFxBrowser.Stop();