Bug 446301 got me thinking about users who want to minimize the amount of traffic that Firefox generates. Right now, one thing we tell them is to disable image loading in in the Preferences, Content pane. However, the addons manager, get addons pane does not respect this preference. Yes I understand that these thumbnails are tiny and this bug is minor but it's a preference that's there for a reason and we might as well respect it.
This sounds like a valid thing to handle
Created attachment 335830 [details] [diff] [review] Patch using empty string url
Comment on attachment 335830 [details] [diff] [review] Patch using empty string url This is not the right place for this code. The image blocking should be based off the actual blocking policy, not just the default, this means checking the content policy for each thumbnail, either in displaySearchResults or in the search result binding where it pulls the thumbnail.
Created attachment 336406 [details] [diff] [review] Patch in extensions.xml Here's the updated patch according to your request, it checks through nsIContentPolicy in the constructor of the thumbnail. Hope this is right.
Comment on attachment 336406 [details] [diff] [review] Patch in extensions.xml Yeah this looks great, just a minor style nit then it will be ready for checkin. >+ <method name="_imageBlocked"> >+ <parameter name="container"/> >+ <body> >+ var uri = Components.classes["@mozilla.org/network/io-service;1"] >+ .getService(Components.interfaces.nsIIOService) >+ .newURI(container.getAttribute("thumbnailURL"), >+ container.ownerDocument.characterSet, null); Line up the arguments with the arguments above to make it clear they are a part of the method call. >+ var contentPolicy = Components.classes["@mozilla.org/layout/content-policy;1"] >+ .getService(Components.interfaces.nsIContentPolicy); >+ if (contentPolicy.shouldLoad(contentPolicy.TYPE_IMAGE, >+ uri, container.ownerDocument.documentURIObject, >+ container, null, null) != contentPolicy.ACCEPT) You can avoid the if statement and just |return contentPolicy... != contentPolicy.ACCEPT|
Created attachment 336623 [details] [diff] [review] patch for checkin Just revved for a couple of new style nits, dropped the surrounding brackets and added a semicolon at the end of the line.
Landed: http://hg.mozilla.org/mozilla-central/rev/d8064eff0a17 Thanks for the patch.