Search code examples
c++imageinternet-explorerbho

How to detect image loading in Internet Explorer (and don't display it)?


I'm writing a BHO add-on for Internet Explore (8 and 9). And I followed this tutorial explaining how to write add-on that hides all images on page. The problem is that these images are hid after the page is downloaded. So for a second there is the full page and then all images disappear. I have to make it that when an user open the page there won't be any images even for a second.

I can't find proper event in DWebBrowserEvents2. Maybe I should look in IHTMLDocument2. I have no idea actually.

Any suggestions?


Solution

  • You cannot do this properly with IE. The DWebBrowserEvents events are fired too late for you to modify the DOM before the images are downloaded.

    You'll see comments referring you to a Async Pluggable Protocol, a method of hooking into IE at a lower-level, but it's rather tricky and not recommended by Microsoft to do this for http/https. Check out the MSDN IE Extension Developer forum for more discussion on this.