views:

84

answers:

1

I am trying to create a custom HTTP request/response logger for Internet Explorer. In my application I have an embedded browser object. I have a pointer to IWebBrowser2 interface. This interface has BeforeNavigate2() and DocumentComplete() methods that get invoked only for base page requests. However those methods don’t get invoked for resource requests (such as JavaScript, images and style sheets files).

Is there an interface that captures requests for resources, or is there any other way to capture resource requests?

A: 

You can set up an HTTP proxy the way Fiddler does, which is at a lower level than the BHO.

You can also try the DownloadBegin event.

Lastly you can implement your own pluggable protocol for HTTP (or maybe you want a MIME filter).

jeffamaphone
Thanks for that. A proxy based solution, like Fiddler, doesn’t not work for me. I need something like BHO.The DownloadBegin event does not work for me because it does not have access to HTTP request headers information. I am also trying to stay away from pluggable protocol because of complexity.I am curious how HttpWatch and HttpAnalyzer browser plugins can read HTTP traffic? Do they use pluggable protocols or there is there a sampler approach? Thanks.
MaxK
IE doesn't expose anything to BHOs like what you want. You can either do the pluggable protocol handler or you have to hook things at a lower level than the browser extensibility model. I'm not sure how those guys work (I suspect PPHs). You could also, theoretically, detour the low-level WININET functions (such as InternetOpenURL, etc). But seriously, I wouldn't recommend doing that. PPH is the right way.
jeffamaphone