HtmlElement head = wb.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = wb.Document.CreateElement("script"); IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement; string alertBlocker = "window.alert = function () { }"; element.text = alertBlocker; head.AppendChild(scriptEl);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)