I'm using C# / .NET 4. I have a form with a WebBrowser component on it. I have loaded an external web page to the WebBrowser component.
I have an event handler attached to the Navigating event. This works for most things. however, one part of the web site I'm loading executes a window.open(url) javascript command. This has the effect of opening a new IE window with the URL, and my event handler does not get called.
I need a solution that either:
- Calls my event handler with the URL that is about to be opened, allowing me to capture the URL and cancel the event as usual.
- Replace the Javascript function (there are many JS functions) that calls
window.open(url)with some JS equivalent that will open the new page in the same window, thereby calling my event handler.