brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.54k stars 2.27k forks source link

Brave Adblock should support $domain alias: `$from` #34288

Open ghost opened 10 months ago

ghost commented 10 months ago

While not many rules use $from (only saw 20 in list.txt), it is just an alias for $domain and nothing is different between the two modifiers https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#domain, so for compatibility reasons, it would be good if Brave supported it.

For example, one of the $from rules was added some days ago with this commit in uAssets to fix spotify ads: https://github.com/uBlockOrigin/uAssets/commit/2ce25d7284b8fcd7d31c12610c7d9eb55797e257. This means the rule is not working in brave at the moment, also, as can be seen in the other spotify rules, 2 use domain and the other 2 use from. Of course I haven't heard of people having issues in spotify, only like a months ago, but it is not good Brave has incompatible rules even if they are just an alias.

So it would be good if Brave supported it, especially when it is just an alias and Brave shouldn't have to re-add something to Brave-Unbreak lists just to workaround when/if an alias is used, unless domain/from used something unsupported like entity or regex.

This is just the same case as when Brave added the :-abp-has() alias support because some rules require it, and if uAssets filter maintainers are going to start adding $from for no reason more and more, then it means Brave should support it, the sooner the better, especially since uBlock already translates all domain modifiers to from in the logger, promoting the use of it even more.

antonok-edm commented 10 months ago

Good call that $from is being used more widely these days. I've been putting it off mainly because supporting $to would be more involved, but there's no reason we can't have $from in the meantime.

https://github.com/brave/adblock-rust/commit/1f966be