Supporting CSS injection rules

Various discussions related to Adblock Plus development
Post Reply
anonuser2
Posts: 3
Joined: Thu Jun 30, 2016 4:28 am

Supporting CSS injection rules

Post by anonuser2 »

There have been a several feature requests regarding CSS injection, for example,

forum/viewtopic.php?p=102421#p102421
forum/viewtopic.php?p=102421#p102421

I understand that this can cause security vulnerabilities, but I just want to add my voice that such a feature will be very useful.
I've been constantly encountering situations that if I hide an element completely, the website layout breaks, and the only way to fix it is to set its height to 0px. Also there are many Russian websites which includes ad image as a background of an element and I think this is why Adguard supported such rules.

Recently ublock origin added support for such functions - https://github.com/gorhill/uBlock/releases, yet their syntax doesn't looking good IMO.
Adguard's syntax "#$#" looks like the most natural extension of standard ABP rules, and also it saves more space ;) In fact, uBO does support this syntax too, not sure why they added their own syntax :style 8)
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Supporting CSS injection rules

Post by lewisje »

I think using function-call-type notation was more extensible, and it only supports AdGuard notation for compatibility (same reason it supports ad-blocking hosts files)
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
anonuser2
Posts: 3
Joined: Thu Jun 30, 2016 4:28 am

Re: Supporting CSS injection rules

Post by anonuser2 »

I don't think adding a bunch of options to an existing syntax is a good idea, it reduces the simplicity of filter rules that are currently being maintained.
Simplicity matters, because filter lists are currently being maintained by humans.

## stands for hiding, #@# stands for whitelisting. I think injecting CSS falls in a different category and does not fit into the meaning of ##, so we need a different syntax for it, which is #$# in Adguard's syntax. This is what I meant when I say "natural extension" :) Btw, I think using hosts files as in Ublock is unnecessary if one is already using EasyList.
User avatar
greiner
ABP Developer
Posts: 899
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: Supporting CSS injection rules

Post by greiner »

Adblock Plus is a content blocker so while the ability to hide elements definitely falls under that category, applying arbitrary styles to elements doesn't, even though the underlying technology is the same. There are various extensions out there that allow you to apply your own styles to websites which are optimized for this very purpose and which can be used in addition to Adblock Plus.
anonuser2
Posts: 3
Joined: Thu Jun 30, 2016 4:28 am

Re: Supporting CSS injection rules

Post by anonuser2 »

Ok I see. Then it would be hard to expect such features in Adblock Plus.. Thank you for your reply!
Post Reply