uBlock Origin: How to add constraints to filter rules?

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
LigH1L
Fanatic
Fanatic
Posts: 122
Joined: 2013-02-22, 19:08
Location: rural central Germany

uBlock Origin: How to add constraints to filter rules?

Unread post by LigH1L » 2017-11-16, 15:41

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?
Fun and success!


User avatar
LigH1L
Fanatic
Fanatic
Posts: 122
Joined: 2013-02-22, 19:08
Location: rural central Germany

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

Unread post by LigH1L » 2017-11-16, 22:17

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

Locked