BLocking DIVs with changing IDs

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
reepicheep
Posts: 126
Joined: Wed Dec 24, 2008 1:15 pm

BLocking DIVs with changing IDs

Post by reepicheep »

I want to block a DIV element with a random (and changing) ID-name. Here's an example from Amazon, where the trick is used for their associates scheme.

Code: Select all

<div id="ns_0D3X5X8JQZWQQEFZG9W5_19579_wrap">
The ID changes even on a reload. For example, a page refresh immediately after the above produced this

Code: Select all

<div id="ns_0XBYD98W9BG7DQ8YH36Z_21118_wrap">
I tried an element hiding rule of

Code: Select all

amazon.com#div(id=ns_*) 
but it didn't fire. Also tried the slightly more specific

Code: Select all

amazon.com#div(id=ns_*_wrap) 
but that doesn't fire either.

Suggestions on how to remove DIVs with similar randomly assigned names would be great.
Dr. Evil
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Post by Dr. Evil »

Code: Select all

amazon.com#div(id^=ns_)(id$=_wrap)
You can't use a asterisk as a wildcard in element hiding rule. But you can match parts of an attribute. There's ^= for the start of the attribute, $= for the end, and *= to match against text anywhere in an attribute.

You can also try the Element Hiding Helper:
https://addons.mozilla.org/en-US/firefox/addon/4364
reepicheep
Posts: 126
Joined: Wed Dec 24, 2008 1:15 pm

Post by reepicheep »

Dr. Evil wrote:

Code: Select all

amazon.com#div(id^=ns_)(id$=_wrap)
You can't use a asterisk as a wildcard in element hiding rule. But you can match parts of an attribute. There's ^= for the start of the attribute, $= for the end, and *= to match against text anywhere in an attribute.
Thanks that works beautifully. Made the appropriate changes for the web site concerned.
You can also try the Element Hiding Helper:
https://addons.mozilla.org/en-US/firefox/addon/4364
Had tried that but it dumped the original random specific ID name in the rule.

But still thanks again for the help.
Wisdom Fluxion
Posts: 15
Joined: Mon Dec 15, 2008 7:59 pm
Contact:

Post by Wisdom Fluxion »

Consider also the extensions which use XPaths to remove content ;)

some examples: rip, aardvark, platypus, greasemonkey, coscripter . there are others.

Obviously not to be used in lieu of AdBlock Plus.

8)
Locked