more injected CSS rules

Various discussions related to Adblock Plus development
Post Reply
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

more injected CSS rules

Post by lewisje »

I recently browsed the AdBlock support site, and I was surprised to find that it used more than just display:none!important to hide content, perhaps to mitigate more specific on-page selectors that set "display:block!important" or something similar, although the page could also just set "visibility:visible!important": http://support.getadblock.com/discussio ... t_37005228

Specifically, AdBlock injects the three rules display: none !important; visibility: none !important; orphans: 4321 !important; and I'm not sure what the relevance of requiring the first 4321 lines of text in a hidden element to stay in its column is; also, I typed those rules exactly as in the post, but I think the correct value for visibility is hidden rather than "none" in that rule.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
architecture
Posts: 1
Joined: Tue Jun 23, 2015 1:30 pm

Re: more injected CSS rules

Post by architecture »

Hi,

That would be fairly geeky functionality - we are looking into making the extension more usable for mainstream users. So replacing Stylish is definitely a non-goal for Adblock Plus.

If defining full CSS styles is required to block ads then this is something to consider. However, there are significant issues with this solution:

a) There are tools to assist creation of such rules and these tools most likely cannot be created at all.
b) The likeliness of people breaking element hiding by invalid CSS rules will increase significantly (this is related to a).
c) This will give a lot more power to filter list authors - e.g. CSS allows adding text to elements (content injection) or using images (tracking).

So this isn't really something that I want to add to Adblock Plus. The question is whether the ads in your examples can be blocked by other means and whether not blocking them is a big issue.

By jigna,
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: more injected CSS rules

Post by lewisje »

architecture wrote:So replacing Stylish is definitely a non-goal for Adblock Plus.
I didn't say it was or should be: All I was asking about was augmenting the current strategy (injecting display:none!important) with more rules, but not in a user-configurable manner, and not via any changes to filter syntax.

So I ask again: Are there any drawbacks to changing the element-hiding behavior to set not just display:none!important but also visibility:hidden!important when ABP injects its element-hiding stylesheet?
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
snoack
Posts: 162
Joined: Tue Aug 13, 2013 7:45 pm

Re: more injected CSS rules

Post by snoack »

The CSS property "visibility :hidden" makes an element merely transparent, but (as opposed to "display: none") it doesn't free the area allocated for that element in the layout. So "display: none" is what we want here. Sure, applying both wouldn't make anything worse on pages that override the "display" property anyway.

However, Adblock Plus is already causing quite high memory usage, as those stylesheets must be injected into every document and frame. Adding even more CSS properties there, might make this even worse. Also note, that websites that overwrite the "display" property to circumvent element hiding, would probably just do the same for the "visibility" property, once we use it as well.
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: more injected CSS rules

Post by lewisje »

I was thinking about those downsides too, but I wasn't sure about whether there were any other issues. Thanks for clearing that up. :)
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Post Reply