Reputation: 573
I need some help to blocking iframes in internet explorer or .NET webbrowser control. I tried security preferences, that doesn't worked. XP and IE8, with .NET Framework 4.0
Upvotes: 1
Views: 1154
Reputation: 224962
In the DocumentCompleted
event for your WebBrowser
, simply remove all the <iframe>
elements:
foreach(HtmlElement x in ((WebBrowser) sender).Document.GetElementsByTagName("iframe")) {
x.OuterHtml = String.Empty;
}
Upvotes: 6