Blocking images that are not linked to a jpg
Blocking images that are not linked to a jpg
I was wondering if all (or most) images on a page (background images, unlinked images, and images linked to other than a jpg) can be blocked from a page, allowing only images that are linked to a jpg file. Thanks.
- Adblock Plus Fan
- Posts: 1255
- Joined: Sat Feb 24, 2007 11:08 am
Re: Blocking images that are not linked to a jpg
I imagine something like this should work:james wrote:unlinked images, and images linked to other than a jpg
Code: Select all
domain.com##IMG:not(A[href$=".jpg"] > IMG)
Wladimir, or someone else, can you explain why this doesn't work?
ABP video download trick / Want to help? Test new builds/report bugs you find.
:not() is very limited in what it can do. If you look at http://www.w3.org/TR/css3-selectors/#negation - only simple selectors can be used, meaning especially that no compound selectors are accepted here (mostly for performance reasons).
In userContent.css one could write something like this (note that the link isn't necessarily a direct parent of the image):
You can also add this snippet of CSS code to Stylish. Adblock Plus isn't that flexible however.
In userContent.css one could write something like this (note that the link isn't necessarily a direct parent of the image):
Code: Select all
@-moz-document domain(domain.com)
{
img
{
display: none;
}
a[href $= ".jpg"] img
{
display: inline;
}
}