Can I remove arbitrary bits of text (or DOM)?

Various discussions related to Adblock Plus development
Post Reply
User avatar
einpoklum
Posts: 3
Joined: Fri Nov 10, 2006 8:52 am

Can I remove arbitrary bits of text (or DOM)?

Post by einpoklum »

I need to remove a certain bit of text from my mail messages (when they're displayed). It could be all limited to a single line; or it could be separated by line breaks (<br> in HTML mail,0x10 in plaintext mail); or it could be contained in several consecutive block elements but display contiguously (the most complicated case).

It is not clear to me from browsing the ABP website and from looking through the menus of the installed extension whether:
  1. This capability is already part of ABP, and I just haven't figured out how to configure it properly.
  2. ABP is close to having this capability, and a modification of the extension could allow it.
  3. ABP does not have this capability, and changing ABP to include it is a fundamental change, in which case I should probably roll my own extension.
My hunch is that option 2 is the correct one, but I would trouble you to confirm this before I start rummaging through the source...

PS - For the sake of simplicity, I'm willing to assume I can remove entire DOM elements rather than have to split them up to only remove the annoying text. I might even live with the ability of only removing block-level elements, although that's kind of borderline for me.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Can I remove arbitrary bits of text (or DOM)?

Post by mapx »

ABP can hide css elements but not arbitrary text in the page

If you want to remove text you'd need a userscript running in greasemonkey / tampermonkey (for firefox / chrome)

see for example
forum/viewtopic.php?p=104854#p104854
User avatar
einpoklum
Posts: 3
Joined: Fri Nov 10, 2006 8:52 am

Re: Can I remove arbitrary bits of text (or DOM)?

Post by einpoklum »

I'm only interested in Thunderbird. Plus, the next phase is removing such text from message drafts when you reply, which would probably make Greasemonkey irrelevant anyway...

still, do you think it would be a good idea to use ABP's infrastructure / codebase as a starting point?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Can I remove arbitrary bits of text (or DOM)?

Post by mapx »

no, ABP is too complex for such a different (simple) task. You need only a userscript which scan the page / text and remove / replace some piece of text.
Post Reply