I'm writing an extension for IE in c#.
I've got a IWebBrowser2
object called browser
and from it I can get an IHtmlDocument2
object like this:
var document = browser.Document as IHTMLDocument2;
Now I need to react on a javascript event which is fired by this code:
var event = document.createEvent("HTMLEvents");
event.initEvent('MyCustomEvent', true, false);
someElement.dispatchEvent(event);
I see that I can use click
, mouseleave
and other properties from HTMLDocumentEvents2 interface to subscribe to typical events, but I can't find something like OnCustomEvent
or HtmlEvents['MyCustomEvent'] += ...
, etc.
It was easy to implement this functionality in firefox add-on, but with IE it's a pain... Is this even possible? Thanks