1

I'm automating an Internet Explorer window using the IWebBrowser API. Is there a way to cancel all outstanding HTTP requests in IE/IWebbrowser?

I've tried the following and none of them work.

  1. Calling IWebBrowser::Stop(). This only cancels navigation and does not stop existing downloads from continuing.

  2. Navigating to 'about:blank'. This stops new requests from being made, but existing HTTP requests will continue.

  3. Calling Abort()/Terminate() on each of the IInternetProtocol handlers. This causes IE to crash (not surprisingly).

watsonmw
  • 321
  • 2
  • 13
  • No, there's not any direct way to do that, although tearing down the browser instance might work. If you embed FiddlerCore in your application, you could terminate the downloads using FiddlerCore, but this would be a lot of work for a task which probably isn't super-useful. – EricLaw Jan 30 '11 at 22:38
  • @watsonmw : Did you find the solution for this problem? – Arpit Mar 08 '17 at 11:56
  • If I remember correctly my 'solution' was to just wait for the requests to finish, with a timeout where i destroy the whole browser instance if they didn't. There's also this technique, may provide a crude way to cancel the requests: http://web.archive.org/web/20130313164317/http://www.blackfishsoftware.com/blog/don/passthroughapp_bho_toolbar_intercepting_requests_responses – watsonmw Mar 09 '17 at 19:52

0 Answers0