Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer Add-on to detect Ajax calls

Using the IWebBrowser2 interface is fairly easy to know when navigation took place (OnBeforeNavigate) and finished (OnDocumentComplete). However, a lot of work in browsers are done through Ajax calls (which use XMLHttpRequest).

Is there a way to subscribe to events tracking when an Ajax call occurred and finished in IE?

like image 655
Otávio Décio Avatar asked Apr 25 '13 14:04

Otávio Décio


2 Answers

The official way is to create a changelog using an IHTMLChangeSink. It's not complicated, but it's a bit tedious to implement so that you don't lose any requests.

I think the best way to do this may be to create an HTTP proxy server, then use InternetSetOption to set the proxy (note that the first argument is NULL to set for the current process) to your local HTTP proxy server.

like image 154
geocar Avatar answered Oct 03 '22 08:10

geocar


This previous question seems to provide an answer:

Monitor ajax calls from IE BHO

It basically says you have to inject some JavaScript to every page to handle onreadystatechange.

like image 37
kichik Avatar answered Oct 03 '22 08:10

kichik