views:

223

answers:

0

Hi, I am trying to inject html and js into an IE from a bho. To get the body I use: Code:

public static SHDocVw.WebBrowser webBrowser;
HTMLDocument document = (HTMLDocument)webBrowser.Document;
IHTMLElement body = (IHTMLElement)document.body;

My idea was to use body.appendChild but that will only work for the webbrowser control and not for SHDocVw.WebBrowser.

I can't use execScript() because I want to also add external js files, that's why I want to use a script element.

How can I in inject a script element into the body or head?