I'm using a C# WebBrowser in order to show a Facebook login dialog for my desktop application. I'm regeistered on the WebBrowser.DocumentCompleted event, and once I get the URL I'm expecting, I stop the WebBrowser, and close the dialog.
For some reason, after closing the dialog, Internet Explorer suddenly opens.
I can only assume that it opens up IE (which is by the way, not even my default browser) because the web server returns the page, and my WebBrowser is already gone. Is that the case? Any idea how to prevent it?
Thanks!
Edit: When I close the WebBrowser, it already contains the HTML that is displayed in the IE.
Sometimes, Internet Explorer and Edge can automatically open if your computer is infected with malware, as such threats tend to hijack web browsers, and open tabs without your input.
you can go to Settings > Default browser > Let Internet Explorer open sites in Microsoft Edge and set it to Always (Recommended). If that didn't work, try to set "Allow sites to be reloaded in Internet Explorer mode" to Default or Allow and see if that fixes the problem.
Go to Advanced > Under settings, look for the setting "Hide the button (next to the New Tab button) that opens Microsoft Edge" and check the box.
If it's a popup. Why not just handle the event? You could do something like this.
{...
WebBrowser wb = new WebBrowser();
wb.NewWindow += new System.ComponentModel.CancelEventHandler(wb_NewWindow);
}
void wb_NewWindow(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}
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