Block Element via Selector - Wildcard Syntax

Hello, I was wondering if there was a wildcard character I could place in Brave’s Block Element via Selector’s dialogue box.

For example, the thing I wanted to block is this:

span.loading1

However, there are multiples of this scattered throughout the page:

span.loading2
span.loading3
etc

If there’s a way to block them all by inputting a wildcard character like “*” (eg. “span.loading*”) that would be great! Thank you.

Also, I apologies if I’m using any incorrect terminology and or if this question has already been brought up. I’ve looked around and have found nothing on the topic.

edit: formatting corrections to encased * in backticks

@dankestmcjr,
Not to my knowledge – however, if there is one, I imagine it would be the * character, as its generally used in regex/expression matching to symbolize “any char”.

Hello @Mattches,

Thank you for the quick reply! I’ve actually tried using * already; however, it doesn’t seem to work.

In the original post I used using * as an example but it italicized my text instead, sorry for the confusion. I’ve edited the original post to reflect using * as a potential wildcard.

@dankestmcjr,
Thanks for checking!
Try using actual CSS syntax – so in your example, try using span[class^=loading]. This will match any class value that starts with loading.
More info here:

2 Likes

@Mattches,

That worked! I’m not actually too familiar with CSS syntax but putting in span[class^=loading] as was your recommendation blocked all the elements I wanted to be blocked. Thank you!

Also, I’d like to recommend that they should add your solution as an additional topic inside of Brave’s support/help page dealing with the Element Blocker (https://support.brave.com/hc/en-us/articles/360018039072-How-do-I-block-additional-page-elements-). It would definitely prove useful as it seems like the guide, itself, was made for those not as well-versed in CSS syntax, such as myself. Thanks again!

1 Like