Page 1 of 1

uBlock Origin: How to add constraints to filter rules?

Posted: 2017-11-16, 15:41
by LigH1L
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?

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

Posted: 2017-11-16, 15:59
by laozi
good evening,
proposal: question to ask here
https://discourse.mozilla.org/t/support-ublock-origin/6746

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

Posted: 2017-11-16, 22:17
by LigH1L
OK, I will try there. Another place to register to ... but it appears lively; yet a bit confusing interface.