Skip to content

has-text selector does not work #537

@mindplay-dk

Description

@mindplay-dk

It seems you do have support for the has-text selector?

check_procedural(
".items:has-text(Sponsored)",
vec![
CosmeticFilterOperator::CssSelector(".items".to_string()),
CosmeticFilterOperator::HasText("Sponsored".to_string()),
],
);

But this does not seem to work in Brave? Anything with :has-text(...) in it does not seem to parse correctly?

It's incredibly hard to tell what's going on - in the "block element" dialog, there is no indication of whether or not your selector is even valid. You can't tell if your selector has a syntax error, or it just doesn't match any elements. I don't understand how people develop or test filters for this ad blocker? Is this really the best/only tool we have for this?

(I want to block "Reels" on facebook, but there are literally no stable selectors to be had anywhere on the page - every single ID and class name are generated at build-time and will change with their next deployment. The only reasonably stable selector would be a text selector. I know this would have performance implications.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions