Advanced Configuration: URL PatternsBFilter allows you to block an arbitrary URL (web address) and to assign hints to URLs in order to influence the heuristic analyzer. In any case you assign some kind of a tag to a URL, so both blocking and hinting (and more) are specified in the same file. Actually there are two files: urls and urls.local, which have only two differences:
1. urls is shipped with BFilter and will be overwritten when you upgrade it.
2. urls.local has a higher priority, so it can override rules specified in urls.
Both files are accessible with the GUI. You are going to make changes to urls.local only. The other one is read-only.
In case you want to know where those files are located:
1. On Windows they are typically located in C:\Program Files\BFilter\conf.
2. On a Mac, they are located in /Library/Application Support/BFilter.
3. On Unix-like systems they can be located in /usr/local/etc/bfilter, /usr/etc/bfilter, or in /etc/bfilter. In case of the GUI version, urls.local is in $HOME/.bfilter, and the one in /usr/local/etc/bfilter is just a template.
The file specifies a number of rules. Each rule has the following syntax:
HTML: output a blank page.
IMAGE: output a transparent image.
FLASH: output a blank flash file.
AD: output an appropriate blank/transparent content.
FORBID: output an error page.
ALLOW: cancel any of the above tags.
NOFILTER: don't filter a page or a script.
+++(any number of plus signs): be more suspicious about the URL.
---(any number of minus signs): be less suspicious about the URL.
-N(where N is a number): alternative syntax for the above.
HintsThe last two tags are special. They provide a hint to the heuristic analyzer and are only considered when we already have an ad suspect. For example if we have a clickable image on a page, we are going to consider hints for:
- The image URL.
- The link URL.
- The page URL.
Note that hints don't intersect with other tags. When we are looking for a hint, we don't consider other tags, and the other way around.
PatternsBFilter supports two types of patters:
- Simple strings with wildcards.
- Regular expressions.
Note that for broad ad-blocking patterns like this, I'd recommend using
FORBID, which would cause error pages in place of IFRAME ads.
Regular expression patterns must be enclosed within two slashes:
You may find a tutorial and a complete reference on regular expressions here.
Note that both simple and regex patterns are case insensitive.
Compatibility with AdBlockAdBlock is a popular extension for the Firefox web browser. It's patterns are mostly compatible with BFilter, except they are not anchored, meaning that
In BFilter, patterns must cover the whole URL, not just a part of it. Of course, you are free to write something like this: