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?
Changing CSS for blocked ads?
Re: Changing CSS for blocked ads?
Could you provide some examples where you still see leftover placeholders ?
Re: Changing CSS for blocked ads?
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.
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.
Re: Changing CSS for blocked ads?
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?
Re: Changing CSS for blocked ads?
From my earlier post:
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.lewisje wrote:it's probably best to set up UserStyles or UserScripts
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Re: Changing CSS for blocked ads?
see https://forums.lanik.us/viewtopic.php?f ... lank+spaceChelsea wrote:I also have a large "blank" area on my yahoo mail page. It's about 1/3 of the page blank.
Re: Changing CSS for blocked ads?
I can reproduce - but unfortunately only random - using an US ip. Could be a site issue.
Re: Changing CSS for blocked ads?
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!