diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-08-21 21:40:59 +0200 |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-08-22 00:50:13 +0200 |
commit | 12f8323ae8e5e469fb0b662f29bd8fedadb85faa (patch) | |
tree | 61a394d0911239e02fbd495cd171e8594fd833b8 /src/adblock/adblockrule.h | |
parent | Restore bk icon on the right (diff) | |
download | rekonq-12f8323ae8e5e469fb0b662f29bd8fedadb85faa.tar.xz |
Add support for domain option in the ad block module
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.
Diffstat (limited to 'src/adblock/adblockrule.h')
-rw-r--r-- | src/adblock/adblockrule.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/adblock/adblockrule.h b/src/adblock/adblockrule.h index ef7b2f5f..701a9fe1 100644 --- a/src/adblock/adblockrule.h +++ b/src/adblock/adblockrule.h @@ -63,6 +63,7 @@ #include <QSharedPointer> // Forward Includes +class QNetworkRequest; class QString; class AdBlockRule @@ -70,10 +71,10 @@ class AdBlockRule public: AdBlockRule(const QString &filter); - bool match(const QString &encodedUrl, const QString &encodedUrlLowerCase) const + bool match(const QNetworkRequest &request, const QString &encodedUrl, const QString &encodedUrlLowerCase) const { Q_ASSERT(encodedUrl.toLower() == encodedUrlLowerCase); - return m_implementation->match(encodedUrl, encodedUrlLowerCase); + return m_implementation->match(request, encodedUrl, encodedUrlLowerCase); } private: |