HELP with whitelisting certain target of Element Hiding rule

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
byzod
Posts: 3
Joined: Sat May 06, 2017 7:09 am

HELP with whitelisting certain target of Element Hiding rule

Post by byzod »

A filter in subscription list hid both the download link (what I want to show) and the advertisement image (what I want to hide), I tried to write a whitelist for the download link but failed.
Fortunately the list update yesterday and fixed the problem.

But I still wonder how can I write such whitelist for it, is it possible?
Considering page below

Sample page of sample site http://A.us:

Code: Select all

<span class="dl">
    <!-- The <a> below is a download link -->
    <a rel="nofollow" target="_blank" href="https://A.us/go/?url=http://pan.baidu.com/s/1boA1T1P">
        Download Link
    </a>
</span>
<div class="buyaoa">
    <!-- The <a> below is an ad. -->
    <a href="https://A.us/go/?url=adbottom" target="_blank" rel="nofollow">
        <img src="https://www.not-an-ad-domain.cn/but-an-ad.jpg">
    </a>
    <div class="comments">
        ...comment list should not be touched...
    </div>
</div>
The original hide rule from subscription list: A.us##a[href*="/go/"] ...(1.1)
It hid both `.dl>a` and `.buyaoa>a`.

I wrote some whitelist rules but none of them works
A.us#@#.dl > a[href*="/go/"] : no effect ...(2.1)
A.us#@#.dl > a[rel=nofollow] : no effect ...(2.2)


Question I want to ask:

1. Why rule (2.1) and (2.2) is not working?
2. How to write a rule (2.3) that can whitelist `.dl>a` while still block `.buyaoa>a` without disabling the subscription rule (1.1)?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: HELP with whitelisting certain target of Element Hiding rule

Post by mapx »

you could try (whitelisting the same rule and then writing a new one for hiding)
A.us#@#a[href*="/go/"]
A.us##a[href*="/go/?url=adbottom"]
byzod
Posts: 3
Joined: Sat May 06, 2017 7:09 am

Re: HELP with whitelisting certain target of Element Hiding rule

Post by byzod »

mapx wrote:you could try (whitelisting the same rule and then writing a new one for hiding)
A.us#@#a[href*="/go/"]
A.us##a[href*="/go/?url=adbottom"]
I know that so I mentioned
How to write a rule (2.3) that can whitelist `.dl>a` while still block `.buyaoa>a` without disabling the subscription rule (1.1)
Actually what I really concerning is why rule (2.1) (2.2) fails because I think the CSS selector is correct and have higher priority than subscription one
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: HELP with whitelisting certain target of Element Hiding rule

Post by mapx »

You have no higher priority. You have first to disable (whitelisting) the previous rule.
byzod
Posts: 3
Joined: Sat May 06, 2017 7:09 am

Re: HELP with whitelisting certain target of Element Hiding rule

Post by byzod »

mapx wrote:You have no higher priority. You have first to disable (whitelisting) the previous rule.
So it's impossible to whitelist `B` if another rule already hide `A`, `B` and `C`?
Then what's the point of a `whitelist` since it can't really whitelist anything?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: HELP with whitelisting certain target of Element Hiding rule

Post by mapx »

Again: You have to whitelist exactly the same previous rule. Then add whatever other hiding rule you want.

en/filters#elemhide_exceptions
Post Reply