Changing CSS for blocked ads?

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
Fed_F0
Posts: 1
Joined: Sat Jul 18, 2015 9:10 pm

Changing CSS for blocked ads?

Post by Fed_F0 »

Hello all,

As we know, adblock is a wonderful plugin that is fantastic at removing unwanted ads on the internet.

The only thing it doesn't do is handle the CSS values of where it removes the ads, creating big blocky holes in the websites it prevents ads being served on. I am interested in using adblock to fill the CSS holes, and am wondering if it is possible to add a bit of code to the utility that changes <div> variables within the pages it serves, like some kind of local CSS to work with the removal of the ads to improve the visual content of the websites. So if an ad was in a <div> that is justified left by 100px, and is 100px by 750px to make room for the Ad, adblock should be able to also hide this <div> width on the page served, removing not only the ad but the space previously required for it.

Is it possible to integrate this into a local stylesheet for the utility to handle locally or is there a way to stop the CSS from being loaded from the server?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Changing CSS for blocked ads?

Post by mapx »

Could you provide some examples where you still see leftover placeholders ?
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Changing CSS for blocked ads?

Post by lewisje »

ABP already has an option to hide placeholders of blocked elements, and I don't know what techniques that uses (maybe it's the equivalent of hiding any element with a href or src property equal to the blocked URL?); still, it might be too complicated and poorly performing to try to figure out how to close up the leftover space in general.

For example, if a webmail application (like Yahoo Mail) sets the width of the mail-viewing area to a certain percentage of the available width, to help leave space for the ads on the right, that extra space will still be there even if the ad URLs are blocked and the space for the ads is hidden, and it's not trivial to figure out what element to widen and how much to widen it; in cases like this, it's probably best to set up UserStyles or UserScripts, because they are so difficult to figure out in general, so this sort of thing is probably out of scope for ABP.

However, much of what you're recommending is already covered by hiding rules, which set the display property of certain elements to none !important, determined by CSS selectors with optional domain specifiers; usually, when ads are hidden in this way, the surrounding content flows in where the ads would have been.

If you're asking about hiding content based on the computed style properties, rather than anything explicitly declared in the markup, keep in mind that getting computed styles causes a reflow and repaint and therefore is slow (this is in addition to reflows and repaints caused by changing those styles), and this could make ABP run very slowly if it does this with several active filters.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Chelsea
Posts: 2
Joined: Sun Apr 17, 2016 8:35 pm

Re: Changing CSS for blocked ads?

Post by Chelsea »

I also have a large "blank" area on my yahoo mail page. It's about 1/3 of the page blank. As a test I disabled Adblock Plus and a large ad appears. When enabled, the ad disappears but the large space on top is still there. And it's the complete top page from left to right. Any idea on how to fix?
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Changing CSS for blocked ads?

Post by lewisje »

From my earlier post:
lewisje wrote:it's probably best to set up UserStyles or UserScripts
If I bother going to my old Yahoo! Mail account again, I'll figure out a good UserScript or UserStyle, and most likely, someone else already has.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
User avatar
smed79
Posts: 1224
Joined: Thu Jan 14, 2010 11:51 pm
Location: EasyList Forum
Contact:

Re: Changing CSS for blocked ads?

Post by smed79 »

Chelsea wrote:I also have a large "blank" area on my yahoo mail page. It's about 1/3 of the page blank.
see https://forums.lanik.us/viewtopic.php?f ... lank+space
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Changing CSS for blocked ads?

Post by mapx »

I can reproduce - but unfortunately only random - using an US ip. Could be a site issue.
Chelsea
Posts: 2
Joined: Sun Apr 17, 2016 8:35 pm

Re: Changing CSS for blocked ads?

Post by Chelsea »

I have about 4 different yahoo email address I used and it was the same problem with all. However, they apparently corrected it because it's normal again. They've done this before & last time it was quite a while before it had been fixed. Thank you!
Post Reply