uBlock Origin: How to add constraints to filter rules?

General discussion, compatibility and contributed extensions.

Moderators: satrow, Lootyhoof, Andrew Gilbertson

LigH1L
Moonbather
Moonbather
Posts: 68
Joined: Fri Feb 22, 2013 7:08 pm
Location: NoDSL.de - rural central Germany

uBlock Origin: How to add constraints to filter rules?

Postby LigH1L » Thu Nov 16, 2017 3:41 pm

I tried to read the documentation of uBlock Origin about the syntax of cosmetic filter rules, but unfortunately it is very brief and lacks of examples covering more complex cases, so I could not even discover certainly which kind of constraints are supported, and how they have to be written to be recognized correctly.

I would like to hide whole div's but not on all pages of a whole domain, rather only if...

a) the loaded pages are in a specific URL path, or
b) this div does not contain a form (possibly of a special class, if that helps selecting it)

I could not easily find an approach for constraint type a) yet, I even doubt paths after domains are supported at all; for constraint type b) I suspect that the pseudo classes :is-not() and :has() may help, but I failed constructing a filter rule that works.

In "English with CSS", I would like uBO to hide ##.pageContentRight > .box:nth-of-type(1) only if this div.box does not have child and grandchild > .boxCnt > form.formHorizontal ... so how may I stitch a working rule using such pseudo classes?

laozi
Moongazer
Moongazer
Posts: 12
Joined: Wed Nov 15, 2017 12:26 pm
Location: PACA

Re: uBlock Origin: How to add constraints to filter rules?

Postby laozi » Thu Nov 16, 2017 3:59 pm

good evening,
proposal: question to ask here
https://discourse.mozilla.org/t/support-ublock-origin/6746

LigH1L
Moonbather
Moonbather
Posts: 68
Joined: Fri Feb 22, 2013 7:08 pm
Location: NoDSL.de - rural central Germany

Re: uBlock Origin: How to add constraints to filter rules?

Postby LigH1L » Thu Nov 16, 2017 10:17 pm

OK, I will try there. Another place to register to ... but it appears lively; yet a bit confusing interface.


Return to “Browser extensions”

Who is online

Users browsing this forum: No registered users and 7 guests