-b blockfile
blockfile blockfile
Block requests to URLs matching any pattern given in the lines of the blockfile. The junkbuster instead returns status 202, indicating that the request has been accepted (though not completed), and a message identifying itself (though the browser may display only a broken image icon). (Versions before 2.0 returned an error 403 (Forbidden).) The syntax of a pattern is [domain][:port][/path] (the http:// or https:// protocol part is omitted). To decide if a pattern matches a target, the domains are compared first, then the paths.
To compare the domains, the pattern domain and the target domain specified in the URL are each broken into their components. (Components are separated by the . (period) character.) Next each of the target components is compared with the corresponding pattern component: last with last, next-to-last with next-to-last, and so on. (This is called right-anchored matching.) If all of the pattern components find their match in the target, then the domains are considered a match. Case is irrelevant when comparing domain components.
A successfully matching pattern can be an anchored substring of a target, but not vice versa. Thus if a pattern doesn't specify a domain, it matches all domains. Furthermore, when comparing two components, the components must either match in their entirety or up to a wildcard * (star character) in the pattern. The wildcard feature implements only a "prefix" match capability ("abc*" vs. "abcdefg"), not suffix matching ("*efg" vs. "abcdefg") or infix matching ("abc*efg" vs. "abcdefg"). The feature is restricted to the domain component; it is unrelated to the optional regular expression feature in the path (described below).
If a numeric port is specified in the pattern domain, then the target port must match as well. The default port in a target is port 80.
If the domain and port match, then the target URL path is checked for a match against the path in the pattern. Paths are compared with a simple case-sensitive left-anchored substring comparison. Once again, the pattern can be an anchored substring of the target, but not vice versa. A path of / (slash) would match all paths. Wildcards are not considered in path comparisons.
For example, the target URL
the.yellow-brick-road.com/TinMan/has_no_brain
would be matched (and blocked) by the following patterns
yellow-brick-road.com
and
Yellow*.COM
and
/TinM
but not
follow.the.yellow-brick-road.com
or
/tinman
Comments in a blockfile start with a # (hash) character and end at a new line. Blank lines are also ignored.
Lines beginning with a ~ (tilde) character are taken to be exceptions: a URL blocked by previous patterns that matches the rest of the line is let through. (The last match wins.)
Patterns may contain POSIX regular expressions provided the junkbuster was compiled with this option (the default in Version 2.0 on). The idiom /*.*/ad can then be used to match any URL containing /ad (such as http://nomatterwhere.com/images/advert/g3487.gif for example).
In version 1.3 and later the blockfile and cookiefile are checked for changes before each request.