Learn Spicie Dynamically Adding Elements to Document Object
See code below: Using SpicIE's OnDocumentComplete event void SpicIE1_OnDocumentComplete(object pDisp, ref object url) { ...
https://www.czetsuyatech.com/2011/02/web-spicIE-dynamic-elements-adding.html
See code below:
Using SpicIE's OnDocumentComplete event
Using SpicIE's OnDocumentComplete event
void SpicIE1_OnDocumentComplete(object pDisp, ref object url) { if (url.ToString().IndexOf("msn") > 0) { if (pDisp is IWebBrowser2) { try { var webBrowser = pDisp as IWebBrowser2; var doc2 = webBrowser.Document as IHTMLDocument2; var element = doc2.createElement("h1"); element.innerHTML = "Hello World"; element.setAttribute("style", "border: 1px solid red;", 1); doc2.body.insertAdjacentHTML("beforeBegin", element.outerHTML); doc2.close(); } catch (Exception e) { MessageBox.Show("Plugin is not loaded properly."); } } } }
Post a Comment