Is there an "OR" filter on uBlock Origin?

608 views Asked by At

I have these two rules:

// case1
##body:has(button[aria-label="違反報告"]) div[class*=__ReactionCounter]
##body:has(button[aria-label="違反報告"]) div[class*=__ItemReactionCounter]

But this set of rules is redundant, I'd prefer "or" thing if possible.

So, I tried the following:

// case2
##body:has(button[aria-label="違反報告"]) div[class*=__ReactionCounter],div[class*=__ItemReactionCounter]

But this actually doesn't block the elements like the above one. This one can be expanded like this:

// case3
##body:has(button[aria-label="違反報告"]) div[class*=__ReactionCounter]
##div[class*=__ItemReactionCounter]

This is not what I want.

Note: The page you can actually test the rules detail.chiebukuro.yahoo.co.jp/qa/question_detail/q11271989336

So, is it possible to use "OR" (do they have?) or something to correctly implement the rule (the case2)? Thanks for your help.

2

There are 2 answers

0
JTFRage On

I don't believe there is an OR filter, but there is dynamic filtering.

More information can be found here: Dynamic filtering: quick guide

0
丶 Limeー来夢 丶 On

Solved the problem. You can use the :is() CSS selector.

Selector list - CSS: Cascading Style Sheets | MDN

So in the above case, you can use :is() like this to create a selector list to group them.

##body:has(button[aria-label="違反報告"]) :is(div[class*=__ReactionCounter], div[class*=__ItemReactionCounter])