I'm writing a BHO that should make a slight modification to a specific page. I'd be using DISPID_DOCUMENTCOMPLETE, but the problem is that the page loads more contents using AJAX on it's onload function.
I think the perfect solution for me would be to run my code after onload has returned. Is there any way to get notified when this happens?
Edit: Actually, its not onload, it's jQuery's ready. I'm afraid there's no clean way to achieve what I want. I guess I'll have to implement a timer and check the page periodically, although I hoped to avoid that.
You could try to use
DISPID_HTMLDOCUMENTEVENTS2_ONREADYSTATECHANGE(you must advise forDIID_HTMLDocumentEvents2) and then useget_readyStatefromIHTMLDocument2.You are lucky that your page is a specific one, you may see a specific sequence of events you can rely on. The general case indeed involves periodic poll (imho)