uBlock icon indicating copy to clipboard operation
uBlock copied to clipboard

Placeholders of blocked images not being shown

Open WalterWW opened this issue 11 years ago • 25 comments

Platform: Debian/Iceweasel Option "Hide placeholders of blocked elements" is unchecked in ublock. Dynamic filtering set to block all 3rd-party content by default.

When I go to a website that has embedded third-party images, I do not see a placeholder. Example screenshot of what it looks like on http://dilbert.com/strip/2015-02-23:

http://i.imgur.com/KgNJilf.png

For comparison, this is what it looks like with Requestpolicy:

http://i.imgur.com/AZiEXn5.png

This is definitely a little bit annoying, because on some pages it is not so obvious that there should be an image, and there is no easy way to tell if something other than ads has been blocked.

And as a follow up to this issue I would like to suggest the following related feature:

The option to show placeholders of blocked elements should only apply to blocked dynamic filtering requests, but not to blocked elements from the filter list. My reasoning here is that most people are probably never interested in seeing placeholders of blocked ads, but they would most likey prefer to see blocked images such as the one in my example above.

WalterWW avatar Feb 23 '15 16:02 WalterWW

Ok, I see. I set visibility to hidden when an element is blocked through a network request. I should just not apply any style when no collapse is demanded.

gorhill avatar Feb 23 '15 17:02 gorhill

@gorhill is it as simple as removing this line?

chrisaljoudi avatar Feb 23 '15 20:02 chrisaljoudi

Almost. I have the fix locally, but I want to be sure it's the right thing to do (feature-wise).

gorhill avatar Feb 23 '15 20:02 gorhill

Testing this in 0.8.8.5-dev.3 I get the following results:

'Hide placeholders' enabled:

Placeholders hidden

'Hide placeholders' disabled:

Placeholders not hidden

It's definitely unhiding something, as can be seen by the difference in the screenshots, but it's still not showing a placeholder for the missing image.

WalterWW avatar Feb 26 '15 14:02 WalterWW

Looks to me we are dealing with a browser-specific behavior. With Chromium, the browser respects the declared image size, 900 x 280. Firefox disregards the declared size and collapses, this is not uBlock doing this.

Edit: Actually, the size with Chromium is 850 x 850. I don't know where that comes from. In any case, uBlock doesn't touch the target element at all when "Hide placeholder of blocked.." is not selected, so whatever the outcome is browser-specific.

gorhill avatar Feb 26 '15 14:02 gorhill

Damn, that sucks :(

So I was curious to see how Requespolicy handles this, as it "correctly" displays the 850x850 container, just as ublock apparently does with Chromium.

What I noticed is that ublock leaves the original 3rd-party source of the image intact, but prevents the image from loading: http://i.imgur.com/imcXSNi.png

Requestpolicy on the other hand replaces the source of the image with an inline data image instead: http://i.imgur.com/LmtgRFo.png

Could that be what's causing the different results?

WalterWW avatar Feb 26 '15 16:02 WalterWW

I found some more information on the issue here:

https://stackoverflow.com/questions/14396356/force-firefox-to-render-empty-image-within-dimensions-specified-by-css

It indeed seems to be a Firefox specific behaviour, where it doesn't keep the specified dimensions for the image if it fails to load.

WalterWW avatar Feb 26 '15 17:02 WalterWW

Is this issue still on your radar, gorhill? Or do you think this isn't something that should be addressed in ublock?

For what it's worth, it was reason enough for me to go back to my trusty RP/ABP combo, because working placeholders are essential to my browsing habits.

WalterWW avatar Mar 10 '15 14:03 WalterWW

Wait I thought I was commenting for #942.

The issue here is browser-specific, and I don't feel like creating code patch because of that one Firefox-specific issue.

gorhill avatar Mar 10 '15 14:03 gorhill

Note that you could as well ask Firefox devs to have Firefox behave like how Chromium behaves.

gorhill avatar Mar 10 '15 14:03 gorhill

Okay, just checking.

Unfortunately different browsers also have slightly different behaviours and other quirks, and this will always be the case. You essentially said that you don't care to make this particular functionality of ublock work in all the supported browsers, which is your decision. At least I now know that as a firefox user who relies on placeholders, I don't need to check back anytime soon.

Don't get me wrong, I still think you're doing a great job with ublock regardless, and I hope you keep up the good work :)

WalterWW avatar Mar 10 '15 14:03 WalterWW

you don't care to make this particular functionality of ublock work in all the supported browsers

The functionality is there, it's just Firefox rendering the placeholder differently. You could as well say Firefox doesn't care rendering the placeholder like other browsers.

gorhill avatar Mar 10 '15 15:03 gorhill

Yes, you are semantically correct. Still, the functionality is not there when using ublock in firefox.

Anyway, I don't feel like arguing. I just wanted to know whether this is something that's still on your radar or not, to which I now have an answer.

WalterWW avatar Mar 10 '15 15:03 WalterWW

By the way, RequestPolicy embed a 1-pixel gif if I remember correctly, so it is kind of hacky as the result is Firefox ending up displaying a 850px x 850px placeholder... is this part of documented standards? There is no guarantee other browsers would give the same result. So I stick to not introduce voodoo code and rather fallback on whatever a browser decides.

gorhill avatar Mar 10 '15 15:03 gorhill

I have no idea if there are any standards documenting this behaviour. All I know is ublock placeholders don't work in firefox, which is unfortunate, but such is life.

WalterWW avatar Mar 10 '15 15:03 WalterWW

For the sake of completeness: Firefox Mobile handles unloaded images the same way as the desktop version, which means there are no placeholders with ublock.

WalterWW avatar Mar 16 '15 10:03 WalterWW

there are no placeholders with ublock

There are placeholders, they just happen to be differently shaped than what you would want, that is just how the browser renders them.

gorhill avatar Mar 16 '15 11:03 gorhill

No, there are no visible placeholders. I have no idea what exactly your obsession with semantics is about regarding this issue, and I don't care. From the point of view of the user this is broken in firefox. And from the point of view of the user it doesn't matter if it's the browser's fault or not, it's just broken. Other addons display placeholders correctly in firefox, while ublock does not.

But seeing that nobody else seems to care about placeholders in the first place, leaving this broken probably doesn't matter much.

WalterWW avatar Mar 16 '15 11:03 WalterWW

obsession with semantics

The difference is that you should file an issue with Firefox: if a network request for an image is blocked for whatever reasons (hosts file for example), you will get the same result, i.e. regardless it was blocked by uBlock or not.

gorhill avatar Mar 16 '15 11:03 gorhill

No. I only have this problem with ublock, so I'm reporting it here. If you for some reason want to be stubborn about it, then that's none of my business. There are other addons for firefox which work exactly the way one would expect and actually show placeholders for blocked images.

WalterWW avatar Mar 16 '15 12:03 WalterWW