summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/adblock/adblockmanager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index 140669c5..73daef88 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -272,15 +272,14 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *pa
kDebug() << "ADBLOCK: BLACK RULE Matched by string: " << urlString;
QWebElement document = page->mainFrame()->documentElement();
- QWebElementCollection elements = document.findAll("*");
+ QWebElementCollection elements = document.findAll("[src]");
Q_FOREACH(QWebElement el, elements)
{
QString srcAttribute = el.attribute("src");
if (srcAttribute.isEmpty())
continue;
- if (!srcAttribute.startsWith(QL1S("http")))
- srcAttribute = host + srcAttribute;
+ srcAttribute = page->mainFrame()->baseUrl().resolved(srcAttribute).toString();
if (filter.match(request, srcAttribute, srcAttribute.toLower()))
{