summaryrefslogtreecommitdiff
path: root/src/adblock/adblockmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/adblock/adblockmanager.cpp')
-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"));