adblockublock-origin

How to use uBlock static filter operator


uBlock wiki says:

Filters such as ||example.com^ are still considered generic.

What is || operator? What does the above filter do?


Solution

  • uBlock uses/supports some AdBlockPlus syntax, you can refer to docs on it: https://help.eyeo.com/en/adblockplus/how-to-write-filters#creating-filters

    You might want to block http://example.com/banner.gif as well as https://example.com/banner.gif and http://www.example.com/banner.gif. You can do this by putting two pipe symbols in front of the filter. This ensures that the filter matches at the beginning of the domain name: ||example.com/banner.gif, and blocks all of these addresses while not blocking http://badexample.com/banner.gif or http://gooddomain.example/analyze?http://example.com/banner.gif.