How to block all cross-site image requests originating for a specific website in Firefox?

2

1

I'm using Firefox 38 and OS can either be Windows 7, Ubuntu 14.04, or Slackware 14.1.

I want to know a way to block all cross-site image requests originating for a specific website. E.g. Consider Superuser.com where images from Gravatar.com, Imgur.com, and other user posted images from Dropbox, Google photos appears. To me, requests to all of the said websites account as cross-site image requests for SuperUser.com.

In a nutshell, if I visit ABC.com then I would like to know a way to block all images (all types, including animated and video previews) that are not from ABC.com but from other sources.

Things I tried so far:

  1. Third party images can be stopped loading by changing the value of permissions.default.image to 3 in about:config. However, this setting applies globally which is unproductive for me.
  2. Per-site permissions via Page Info -> Permission -> Load Images -> Block isn't working for me somehow.

    I found that permissions.sqlite in current Firefox profile has image related permissions. I changed it to 3 but to no avail.

  3. I tried Image Block and QuickJava but they do global image blocking, and I would have to interfere in my browsing by tapping their icon on toolbar to enable/disable them.
  4. RequestPolicy does the job well but the addon always runs in Whitelist mode while I require Blacklist mode in it.
  5. I couldn't come up with a technique to use Adblock Plus for the goal since it also works with Whitelist mode. (Related)

Note that I cannot afford to go for a image hunt by using the solution here since the specific website could be any amongst the websites I visit, and cross-websites can be too much to kill for using that solution.

So, how do I achieve my goal?

Edit: Can per link based cross-site image blocking be achieved compared to per domain based? This answer achieves the latter. E.g. I wouldn't want to see any image on this page of Meta.SE but I have no issues with loading third-party images on other pages (like this page) of Meta.SE.

Firelord

Posted 2015-06-27T13:56:13.710

Reputation: 321

What problem are you trying to solve by doing that? – Daniel Beck – 2015-06-27T14:08:18.733

1@DanielBeck I don't want images from other websites to be visible when I load some ABC.com. Not globally but for ABC.com. // I reduced the scope for answering, see my edit please. – Firelord – 2015-06-27T14:10:30.697

Answers

1

The imglikeopera plugin has an option:

  • load images for the originating Web site only;

that you can set for a given website only (called a filter) using the preferences/settings. You can export/import the filters for easier editing. An example file contents to block this page:

[ImgLikeOpera]
http://http://superuser.com/questions/933496/ 4

meuh

Posted 2015-06-27T13:56:13.710

Reputation: 4 273

In the reviews someone says to work on firefox 37 do this "Go to about:config and change browser.cache.use_new_backend_temp to false"

– meuh – 2015-06-27T14:57:44.610

+1 Thank you very much since the addon is very helpful. Could you please add an example of the filter? Can this filter achieve per link based cross-site image blocking compared to domain based which it currently does? E.g. Can the filter achieve: blocking all non-[SU] images (like Imgur, gravatar) on current page but does not block all images on other pages of [SU]? – Firelord – 2015-06-27T14:57:52.567

I think it can do what you want. If the default is to load all images, you can provide a filter rule which is just the url of the page you want to block, and select dont load images. – meuh – 2015-06-27T15:39:15.397

Thanks a lot since it does the job precisely. I wish it could have auto reload functionality but that's a request reserved for developer only. :) As for the favor to ask, would you please post or link your answer to this and this question? That would be very kind of you since I don't want to get reputation solely based on your efforts here.

– Firelord – 2015-06-27T15:49:48.590

@Firelord, done. thanks. (I wouldnt have minded if you had answered those questions). – meuh – 2015-06-27T16:17:06.160