Blockable Items - no image preview

Posting here is no longer possible, please use the corresponding product forum.
Locked
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Blockable Items - no image preview

Post by Gingerbread Man »

I searched this forum for "preview", but that didn't turn up anything. Can anyone confirm this?

When you hover the mouse cursor over an image resource in the Blockable Items pane, you're supposed to see a preview of that image. I get the usual tooltip with various info, but no preview. I've verified that extensions.adblockplus.previewimages is still at its default setting, true.
It seems to be a problem for all images, regardless of size or format, or whether any filters whatsoever apply to them.

Firefox 18.0
Adblock Plus 2.2.1
User avatar
Crits
Posts: 394
Joined: Mon Jan 16, 2012 11:54 am
Location: France
Contact:

Re: Blockable Items - no image preview

Post by Crits »

Is this related to that?
forum/viewtopic.php?t=6012
Author of Liste FR, an ad-blocking subscription for French websites
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Blockable Items - no image preview

Post by Gingerbread Man »

Are you saying it works for you?

They're just plain inline images, not object subrequests or backgrounds. But I do get missing dimensions as well, so it might be related. Thank you for the link.

92 KB, 1182 × 1568
Image

I used these examples in the screenshot:
User avatar
Crits
Posts: 394
Joined: Mon Jan 16, 2012 11:54 am
Location: France
Contact:

Re: Blockable Items - no image preview

Post by Crits »

Well, I can actually reproduce the bug. No preview on no image whatsoever (even if the blockable item list is opened before loading the page), so it's indeed not related to the aforementioned discussion.

Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
Adblock Plus 2.2.2a.3610
Author of Liste FR, an ad-blocking subscription for French websites
Cortex

Re: Blockable Items - no image preview

Post by Cortex »

It happens to me once i upgrade past Firefox 17, if I go to 18 or 19, it will not longer show image previews, but if i go back to Firefox 17, it fixes it
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Blockable Items - no image preview

Post by Gingerbread Man »

No change with Adblock Plus 2.2.2, in case anyone was wondering.
Cortex

Re: Blockable Items - no image preview

Post by Cortex »

Yeah, still no fix, and I really dont want to just stick on Firefox 17 forever simply because this little bug has yet to be fixed.
guest

Re: Blockable Items - no image preview

Post by guest »

This issue is caused by Gecko 18 borking most usage of openCacheEntry(). This can be fixed by modifying sidebar.js to use asyncOpenCacheEntry() instead of openCacheEntry() . Here's diff output for a patch:

Code: Select all

294,296c294,313
< 		try {
< 			var descriptor = cacheSession.openCacheEntry(item.location, Ci.nsICache.ACCESS_READ, false);
< 			descriptor.close();
---
> 		var descriptor = null;
> 		let cacheListener = {
> 			onCacheEntryAvailable: function(desc, accessGranted, status)
> 			{
> 				if (!desc)
> 				{
> 					showPreview = false;
> 					return;
> 				}
> 				descriptor = desc;
> 				descriptor.close();
> 				// Show preview here since this is asynchronous now
> 				// and we have a valid descriptor
> 				E("tooltipPreview").setAttribute("src", item.location);
> 			},
> 			onCacheEntryDoomed: function(status) {}
> 		};
> 		try
> 		{
> 			cacheSession.asyncOpenCacheEntry(item.location, Ci.nsICache.ACCESS_READ, cacheListener);
298c315,317
< 		catch (e) {
---
> 		catch (e)
> 		{
> 			// Not sure we can get here, but just in case...
299a319
> 			Cu.reportError(e);
306d325
< 		E("tooltipPreview").setAttribute("src", item.location);
Note that this was applied to a modified Adblock Plus 2.1.2 and not the latest release 2.4 so be careful about line numbers when using this, but you get the idea.
User avatar
greiner
ABP Developer
Posts: 858
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: Blockable Items - no image preview

Post by greiner »

This has now been fixed (see https://hg.adblockplus.org/adblockplus/rev/e39995e07eb9). You can either try it in the latest development builds or wait for the next release.

Thanks everyone for your patience.
Locked