summaryrefslogtreecommitdiff
path: root/src/adblock/adblockrulefallbackimpl.h
Commit message (Collapse)AuthorAgeFilesLines
* Add support for domain option in the ad block moduleBenjamin Poulain2010-08-221-1/+4
| | | | | | | | | | | | | | | | | | Some ads were not filtered because they were incorrectly matched by the whitelist. This is because we ignore options, including the domain restrictions. For example, the white filter: @@||pagead2.googlesyndication.com/pagead/show_ads.js$domain=kde.org would match any page regardless of the domain restriction. So no ads from pagead2.googlesyndication.com were filtered. This patch adds support for "domain" options in the fallback rules (the other AdBlockRuleImpl rejects options). The domain of the frame making the request is now compared to the option to take the right decision. This patch requires Qt 4.7 with a recent QtWebKit 2.0.
* Improve the performance of AdBlockRuleTextMatchImplBenjamin Poulain2010-08-191-1/+1
| | | | | | | | | | Comparing unicode string without case sensitive is rather expensive because each codepoint must be converted, which is non trivial for unicode. This patch introduce a new argument of ::match() taking the encoded url in lowercase. This way, the conversion can be done only once for a lot of rules.
* Split AdBlock rule in two classes to move the implementation out of itBenjamin Poulain2010-08-181-0/+47
In order to make special matching rules, we need specialization of the implementation depending on the type of rule. The previous AdBlockRule was entierly based on regexp. The new one is only a factory to a AdBlockRuleImpl, and delegate everything to this implementation. This will allow faster specialization of the ad block rules in the future.