In my C# / .NET 4 project, I have a form containing a WebBrowser
component that loads an external web page.
An event handler is connected to the Navigating
event which usually works well. However, there is an issue when a specific part of the loaded website triggers a window.open(url)
javascript command, opening a new IE window and bypassing my event handler.
I am looking for a solution that can either:
- Trigger my event handler with the URL before it opens, giving me the ability to capture and possibly prevent the event as usual.
- Modify the Javascript function that calls
window.open(url)
(since there are multiple such functions) to open the new page in the same window, thus calling my event handler effectively.