From 90eab081fa7f46961cd1597a7cb98c1dc32bd0b8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 24 Feb 2013 18:25:01 +0100 Subject: AdBlock Improvement Hiding rules support (at least the easy ones, the most ones, against hiding id && classes) :D To test it, take a look (in example) at the url: http://simple-adblock.com/faq/testing-your-adblocker/ --- src/webtab/webpage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/webtab/webpage.cpp') diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp index 958dc5c1..b61f66cf 100644 --- a/src/webtab/webpage.cpp +++ b/src/webtab/webpage.cpp @@ -38,6 +38,7 @@ #include "rekonq.h" // Local Includes +#include "adblockmanager.h" #include "downloadmanager.h" #include "historymanager.h" #include "iconmanager.h" @@ -175,6 +176,8 @@ WebPage::WebPage(QWidget *parent, bool isPrivateBrowsing) connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted())); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); + connect(this, SIGNAL(frameCreated(QWebFrame *)), AdBlockManager::self(), SLOT(applyHidingRules(QWebFrame *))); + // protocol handler signals connect(&_protHandler, SIGNAL(downloadUrl(KUrl)), this, SLOT(downloadUrl(KUrl))); } @@ -292,7 +295,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r if (!settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) { // Get the SSL information sent, if any... - KIO::AccessManager *manager = qobject_cast(networkAccessManager()); + NetworkAccessManager *manager = qobject_cast(networkAccessManager()); KIO::MetaData metaData = manager->requestMetaData(); if (metaData.contains(QL1S("ssl_in_use"))) { @@ -502,7 +505,7 @@ void WebPage::loadStarted() int value = val.toInt(); if (value != 10) - mainFrame()->setZoomFactor(QVariant(value).toReal() / 10); // Don't allox max +1 values + mainFrame()->setZoomFactor(QVariant(value).toReal() / 10); // Don't allox max +1 values } -- cgit v1.2.1