uBlock - hide any element that contains text with a given word?
Try ##div>a:has-text(/Trump/)
:has-text()
is a procedural cosmetic filter. Those "must always be specific, i.e. prefixed with the hostname of the site(s) on which they are meant to apply."
Procedural cosmetic filters are powerful but to be avoided if possible as they can slow down site loading (JavaScript has to be inserted and visit lots of nodes).
If you still want it, it should look like this:
example.com,domain.com,anotherexample.com##div>a:has-text(Trump)
You can change that behaviour so a non-specific procedural cosmetic filter like ##div>a:has-text(Trump)
will work, but it is absolutely not recommended. It will slow down your browser on every page and there's the possibility that errors in external filterlists will go free-turning and produce lots of false positives / overblocking.
You can find that option buried in
- uBO Dashboard
- Settings
- Check "I am an advanced user"
- Read and understand the warnings
- Click the gears
- Change "allowGenericProceduralFilters" to
true
- Click "Apply changes"
p.s.: Forward slashes like :has-text(/Target words/)
are not needed. If you use them, the expression inside will be evaluated as RegEx which will cause even more workload.