summaryrefslogtreecommitdiff
path: root/src/adblock/adblockruletextmatchimpl.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-04-10 01:22:48 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-04-10 01:22:48 +0200
commit4b9753d82fceacfdd6db5d6e3f671aed7cc390ba (patch)
tree646138daa9014a074b032e64645384b4a77d7b06 /src/adblock/adblockruletextmatchimpl.cpp
parentFix History ordering (check about:history page before and after this patch) (diff)
downloadrekonq-4b9753d82fceacfdd6db5d6e3f671aed7cc390ba.tar.xz
AdBlock Improvements:
- implemented "third party" support - do NOT block first requests (you cannot even see a blank page, sometimes...) BUG:270356 PS: Alberto, can you pls check this really works for you before backporting to 0.7 and let me know about? Many thanks for.
Diffstat (limited to 'src/adblock/adblockruletextmatchimpl.cpp')
-rw-r--r--src/adblock/adblockruletextmatchimpl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/adblock/adblockruletextmatchimpl.cpp b/src/adblock/adblockruletextmatchimpl.cpp
index d8ec70b6..f3f93204 100644
--- a/src/adblock/adblockruletextmatchimpl.cpp
+++ b/src/adblock/adblockruletextmatchimpl.cpp
@@ -30,6 +30,9 @@
// Rekonq Includes
#include "rekonq_defines.h"
+// Qt Includes
+#include <QNetworkRequest>
+
AdBlockRuleTextMatchImpl::AdBlockRuleTextMatchImpl(const QString &filter)
: AdBlockRuleImpl(filter)
@@ -43,8 +46,11 @@ AdBlockRuleTextMatchImpl::AdBlockRuleTextMatchImpl(const QString &filter)
bool AdBlockRuleTextMatchImpl::match(const QNetworkRequest &request, const QString &encodedUrl, const QString &encodedUrlLowerCase) const
{
+ // this basically lets the "first request" to pass...
+ if(!request.hasRawHeader("referer"))
+ return false;
+
Q_UNUSED(encodedUrl);
- Q_UNUSED(request);
// Case sensitive compare is faster, but would be incorrect with encodedUrl since
// we do want case insensitive.
// What we do is work on a lowercase version of m_textToMatch, and compare to the lowercase