# This file will get overwritten when uprgading BFilter.
# You should place your own rules to rules.local.

# =============== DEFAULT VALUES ===============

# filter:
# 1 - check for ads and apply the appropriate transformations
# 0 - serve the page as is
filter=1

# ad:
# 0 - standard procedure for is_ad decision
# 1 - force negative is_ad decision
# 2 - force positive is_ad decision
ad=0

# scripts:
# 0 - leave as is
# 1 - remove 3rd party scripts except in header
# 2 - remove 3rd party scripts from everywhere
# 3 - only allow scripts in header and those 1st party scripts
#     that don't contain ".write"
# 4 - only allow scripts in header and those 1st party scripts
#     that contain "function "
# 5 - only allow scripts in header
# 6 - only allow 1st party scripts and only in header
# 7 - remove all scripts
#
# The default value of 3 is effective against js-generated ads, but
# breaks some sites which are too much dependent on javascript.
# Fortunately, the built-in javascript engine mostly solves this problem.
scripts=3

# jsengine:
# 0 - don't use
# 1 - use if possible
#
# When the js engine is used, the 'scripts' parameter is ignored.
# The output of a script (generated by document.write or writeln) is
# directed to the standard ad detector. If it detects an ad, the script
# gets removed.
jsengine=1

# target_blank
# 0 - leave as is
# 1 - remove
#
# A link may be marked to be opened in a new window by specifying a
# target="_blank" attribute of an <A> tag.
# If this parameter is set to 1, these attributes will be removed.
target_blank=0

# ================ RULES ===============

# Rules are used for blocking ads which aren't automatically detected
# and/or for dealing with false positives.
# 
# The rule format is:
# [regex]
# param1=val1
# param2=val2
#
# The regex gets converted to "^http://"+regex+"$"
# Regexes use the POSIX extended syntax [see regex(7)]
# For those unexperienced with regular expressions, a few explanations:
# . means "any character"
# \. means "the . character"
# \? means "the ? character"
# .* means "any number of any characters (possibly none)"
# (this|that) means "this or that"
# (something)? means "something or nothing"
#
# You may use any of the global parameters (filter, ad, scripts, jsengine)
# in rules. The parameters you don't specify are implicitly set to the
# corresponding default value.
#
# It is possible to have several rules match a signgle url. In this case
# the lowest values for each parameter are used. That is, the values for
# different parameters may be taken from different rules.

[(.*/)?banners?(/|\.).*]
ad=2

[(.*/)?ad[sv]?(/|\.).*]
ad=2

[(.*\.)?ad[0-9]*\..*]
ad=2

[.*\.akamai.net/.*]
ad=1

[(www\.)?hitweb\.info/Download\.asp\?.*]
jsengine=0

# this one is used to count page views for projects hosted on SourceForge
[(www\.)?sourceforge.net/sflogo.php\?.*]
ad=1

