Blocking images with webbrowser?
I've done a search on here for suggestions on how to do this, but haven't had much luck...I found this:
Code:
Dim I As Long
With webbrowser1.Document.images
For I = 0 To .length - 1
.Item(I).removeAttribute "src"
Next I
End With
The problem is this loads the images and then removes them...I am trying to speed up my program by making it NOT load the images at all.
http://social.msdn.microsoft.com/For...5-3e95845c5324 gives the solution of disabling inline images, which I know is doable but this is where I get more needy...I want to selectively disable images based on a list of images I don't want loaded rather than have them all disabled, if possible...has anyone got suggestions?
One suggestion that was made was to load the HTML then remove what I didn't want and then load the HTML into the browser window, but this isn't an option as I have no way to load the HTML from the webbrowser until it is finished downloading the page...or is there a way using beforenavigate which will work? The problem with beforenavigate and using another method for downloading the HTML is that the site I am working with expects all sorts of cookies and referer tags and stuff, so it NEEDS to be downloaded by the webbrowser so really I need to catch the HTML as soon as it is downloaded then do the work THEN display it without the images I have removed.
Any suggestions or thoughts would be appreciated, and I'll use the suggestion made on MSDN for now :-)
Re: Blocking images with webbrowser?
No-one got any thoughts or ideas about possible solutions?
I know there's an advanced trick involving redefining how webbrowser handles certain stuff, but I have no idea what to do exactly or what it involves