Support for wildcards in Custom filters
*##+js(filter) // not working in brave shields , but working in ublock origin
please add support for wildcard it is important feature...
*##+js(filter) // not working in brave shields , but working in ublock origin
please add support for wildcard it is important feature...
Hi @buzaro, thanks for reporting this! To better understand and implement wildcard support for custom filters, could you please clarify a few details:
-
Which wildcard patterns are you trying to use?
*(asterisk for any characters)?(question mark for single character)- Regex patterns like
/pattern/ - Or something else?
-
Can you provide a concrete example filter that works in uBlock Origin but not in Brave Shields? For example: What should this filter do? Are there specific websites where you tested this?
-
Is this for procedural filters (cosmetic filters) or network filters?
-
Are you using the standard uBlock Origin syntax? Reference: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters
This will help in prioritize and implement the feature correctly. I saw some related issues tracked:
- #194 - Wildcard TLD domains (entity matching)
- #415 - ABP syntax with inline CSS/Remove (includes
*wildcards)
Any additional details or test cases would be very helpful!
*##+js(filter) // not working in brave shields , but working in ublock origin please add support for wildcard it is important feature...
Hi @buzaro, thanks for reporting this! To better understand and implement wildcard support for custom filters, could you please clarify a few details:
1. **Which wildcard patterns are you trying to use?** * `*` (asterisk for any characters) * `?` (question mark for single character) * Regex patterns like `/pattern/` * Or something else? 2. **Can you provide a concrete example filter that works in uBlock Origin but not in Brave Shields?** For example: What should this filter do? Are there specific websites where you tested this? 3. **Is this for procedural filters (cosmetic filters) or network filters?** 4. **Are you using the standard uBlock Origin syntax?** Reference: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filtersThis will help in prioritize and implement the feature correctly. I saw some related issues tracked:
* [Wildcard TLD domains ("entity" matching) #194](https://github.com/brave/adblock-rust/issues/194) - Wildcard TLD domains (entity matching) * [Support for the new ABP syntax `Inline CSS` and `Remove` #415](https://github.com/brave/adblock-rust/issues/415) - ABP syntax with inline CSS/Remove (includes `*` wildcards)Any additional details or test cases would be very helpful!
hey @R0h1tAnand thanks for replying
- Which wildcard patterns are you trying to use?
*(asterisk for any characters)
- Can you provide a concrete example filter that works in uBlock Origin but not in Brave Shields?
so in ublock origin if you use this rule
*##+js(custom-filter.js)than this rule will work for every domain , subdomain basically everywhere . But if you use same rule*##+js(custom-filter.js)in brave shields than this will not work instead you have to specify every domain name manually , like :example.com,google.com,facebook.com##+js(custom-filter.js).
For example i have a custom scriptlet which will allow me to use right click if website blocks it , i want this scriptlet to apply it everywhere but as wildcard feature is not there in brave shields i have to specify domain manually every time.
It's also very useful if someone don't want any images in any website they could use this filter:
*##imgwhich will block img tag on all domains.
- Is this for procedural filters (cosmetic filters) or network filters?
procedural filters
- Are you using the standard uBlock Origin syntax?
yes
One more similar issue exist in brave-browser repo : https://github.com/brave/brave-browser/issues/45839
I tried to use this in an up-to-date Brave and it didn't work, so I'm guessing it is not implemented yet?
But the current state is a bit confusing for me. Some places indicates that it is implemented and... not, at the same time 🤔 ?
- Comment in this PR, even though the PR itself is closed, not merged.
- Closed issue about this.
- This issue itself was closed than reopened.
I care about this, so if you could provide an update on the current state and some guidance on pending work, I might be able to help.
I ran into the same issue on Brave Android. Generic cosmetic filters like ##*:style(...) and *## *:style(...) still don't work for me in the current version. I also found the closed #586 PR and the reopened #582 issue, so I'm equally unsure about the current implementation status.
Bruh, I'm a fking idiot... By writing, for example: net,org,com##*:style(font-weight: bold !important;) this affects all domains ending in these TLDs (Top-Level Domains).