summaryrefslogtreecommitdiff
path: root/src/adblock
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-07-06 22:46:16 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-07-06 22:46:16 +0200
commit67ed4f88998e30b90cfcb93cd8e6bd7e4d0ae7bd (patch)
tree2cf2c3b2034265ee4111cce99c03466c6314c745 /src/adblock
parentFixed a line that was calling QString::startsWith() without args. Fixed build. (diff)
downloadrekonq-67ed4f88998e30b90cfcb93cd8e6bd7e4d0ae7bd.tar.xz
Fix adblock hide behavior
NOTE: You'll find also some style & copyrights fixes here. Just reenable the git hooks scripts... BUG: 302050
Diffstat (limited to 'src/adblock')
-rw-r--r--src/adblock/adblockmanager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index f2c71640..140669c5 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -275,7 +275,13 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *pa
QWebElementCollection elements = document.findAll("*");
Q_FOREACH(QWebElement el, elements)
{
- const QString srcAttribute = el.attribute("src");
+ QString srcAttribute = el.attribute("src");
+ if (srcAttribute.isEmpty())
+ continue;
+
+ if (!srcAttribute.startsWith(QL1S("http")))
+ srcAttribute = host + srcAttribute;
+
if (filter.match(request, srcAttribute, srcAttribute.toLower()))
{
el.setStyleProperty(QL1S("visibility"), QL1S("hidden"));