How to restrict the following uBlock rule to `a` having the attribute `href` ending with *mysuffix*?

```
##li:has-text(mytext) > a
```
Apr 6, 1:50pm

To restrict your uBlock Origin rule to only target <a> elements with an href attribute ending with mysuffix, you can use the following CSS selector:

css
##li:has-text(mytext) > a[href$="mysuffix"]

Explanation:

  • a[href$="mysuffix"]: Selects <a> elements where the href attribute ends with mysuffix.
  • ##li:has-text(mytext) > a[href$="mysuffix"]: Combines this with your original rule, so only <a> elements inside <li> with text mytext and an href ending in mysuffix are targeted.
Apr 6, 1:50pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Le Chat can make mistakes. Check answers. Learn more