I write something like adblock for ie. It has to parse the page, find unwanted ads and replace them with wanted ads.
The problem i faced is when to parse and what to parse.
My first idea was to do parsing in a temporary mime filter, but in this case there is a lot of "unresolved" code (internal/external scripts that can modify documen and are executed after parsing).
It is also possible to make filter for image/*, load wanted ad myself and return it in filter's Read method but i have to modify ad's "href" so the problem is not solved completely. Also, this approach does not work for activex(flash).
After that i tried to parse DOM from BHO, but in this case unwanted objects are displayed for a while before I can replace them.
So the best soluton whould be to parse DOM while it is being built or before it is rendered. Or may be to receive something like BEHAVIOREVENT_CONTENTREADY for commom elements.
Any ideas on how to solve described problem?
If we assume that mshtml worlks like msxml (see the diagram)
then true filtering can be mabe when the DOM is built or when it is written to the application(IE). Is that possible?
there seems to be some effors similar on codeplex.com
Since this thread is a little old, I would like to add that there is a new free adblocker for IE available.
It is called simple adblock: http://simple-adblock.com and so far it has worked impeccable
- Proposed as answer by cunningerness Sunday, November 01, 2009 5:43 PM
simple adblock: http://simple-adblock.com and so far it has worked impeccable
> Simple Adblock is supposed to be easy for everyone to use.
> Therefore that is not an option, but we are working on a way
> to make it easy to edit filters and hide elements.
Will this be emulating the firefox extension: Karma Blocker?
EXCELENT plan using the exact adblock plus format
^ does that mean full support for adblock plus 1.1 filters?????
does it have context menu entries to bllock flash and other objects like Adblock Pro (for ie)?
what kind of 'free' is simple adblock? OSS, freeware, nefarious plans?
Any plans to emulate these other greatt firefox extensionns:
yet another remove it permanently
remove it permanently
xpath? css selectors?
tolerate nothing wrong