Page 1 of 1

Blocking gif images and rule creation

Posted: Sat Jul 04, 2015 1:50 pm
by Zankudo
I am new to using ABP, I read the tutorials about creating filters, but I am getting confused

My goal is to just block gif images, so I created such rule, but I cant get it to block only gif images:

"||tumblr.com^$image"

In my desperation, I searched the internet and found two options:
A tumblr.com/*.gif
B .gif|$domain=example.com,image

Options which just confused me about creating rules.

1 Could someone kindly explain to me why
this rule ".gif|$domain=example.com" does NOT work as written without "image" while this one "tumblr.com/*.gif" works without "image"?

2. After reading the tutorial offered by adblockplus . org, I cant figure out, why this rule written as it is, works, could someone explain?
".gif|$domain=example.com,image"

3. How is it possible that the .gif extension in "tumblr.com/*.gif" AND ".gif|$domain=example.com" are in different places, and still work?

4. Does the rule "||tumblr.com^$image" could be use to block gif images? If YES, What else does the rule needs or what modification needs?

Thanks in advance, at least please, answer number 4.

Re: Blocking gif images and rule creation

Posted: Sat Jul 04, 2015 2:13 pm
by mapx
you can use
1.

Code: Select all

||tumblr.com/*.gif
==> will block only the images on tumblr.com (first party). it wont block images on cloudfront for example this one
or
2.

Code: Select all

.gif$domain=tumblr.com
==> will block all gif images (on tumblr.com but also on other sites but still on tumblr pages). Unfortunately will block elements which are not images
or
3.

Code: Select all

.gif$domain=tumblr.com,image
==> will block only images (on tumblr but also on other sites but still on tumblr pages)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
if you are using

Code: Select all

.gif|$domain=tumblr.com,image
will block all the gifs where the address ends in .gif but not gifs like this

so, your best choice is the third filter

Code: Select all

.gif$domain=tumblr.com,image

Re: Blocking gif images and rule creation

Posted: Tue Jul 07, 2015 2:50 am
by Zankudo
so, your best choice is the third filter

Code: Select all

.gif$domain=tumblr.com,image
I appreciate your answers, but where did you learn how to understand the syntax of the rules, for example: .gif$domain=tumblr.com,image, why is .gif can be placed at the beginning, and why it is necessary "image", if you are already specifying .gif to be block? Please reply, if not, it is ok.

Re: Blocking gif images and rule creation

Posted: Tue Jul 07, 2015 8:32 am
by mapx
why image ? I already explained: could be some other element which contains .gif in its name and you don't want to block it

about filters:
en/filter-cheatsheet
en/filters