I came to the conclusion that the .NET WebBrowser component is practically useless in this regard. I tried to read WebBrowserNavigatingEventArgs.TargetFrameName , but it will return the name attribute of the iframe element only if it has an HTML document. Otherwise, he will spit out the empty string "" . Returning a null value for non-frame links would be more useful.
So, the only fix I found for this is using the AxWebBrowser control and, in particular, listening to the BeforeNavigate2 event. I did not test as much as I should, but it seems that the "flags" property in DWebBrowserEvents2_BeforeNavigate2Event set to 64 every time the user starts.
private void axWebBrowser1_BeforeNavigate2(object sender, AxSHDocVw.DWebBrowserEvents2_BeforeNavigate2Event e) {
MSDN docs say flags is only an IE7 + parameter, so I don't know what happens on IE6 machines ...
Using Internet Explorer from .NET , there is some really valuable information about AxWebBrowser.
source share