IE BHO: Including local images in a remote page…

By lightman76

I’ve been writing an IE plugin (or BHO) and ran across a problem when I tested it under IE 7.  When I included images off of the local harddrive, most didn’t show up under IE7 (but worked fine under IE 6).  However, I noticed that one image I was using did work.

The difference was that this image was a CSS style background.  So I was able to work around this problem by simply converting all of my images to be spans/divs with the style.backgroundImage=”url(’path to local image file‘)”.

Of course the caveat is that this behavior is probably not something they intended, and may fix it at some point.  But until then, it’s an easy change (compared to using the res protocol or a custom protocol – mentioned in the BhoWiki ) to get the job done.  Also, I’ve heard that the IE7 is slightly different under Vista as compared to XP.  I have been testing IE 7 under XP using the Microsoft Virtual PC testing images they have freely available for download (Info about it here and download page actually has XP with IE6 (if you have upgraded to IE7 already) and XP with IE7 (in case you still are running IE6 or Vista).  The article links to an older version of Microsoft Virtual PC, but you can use the latest one here (I’ve noticed it fixed some issues I saw under the old version).

Leave a Reply

You must be logged in to post a comment.