views:

11

answers:

1

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:

  1. 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.
  2. 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.
A: 

Im not versed with the Webbrowser-control, but there is a NewWindow-Event, sounds like it's the thing you are looking for.

Dr.Molle