From 2f764f0a25b4158cde10e246a6bddf5a220bc171 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 22 Dec 2012 12:14:55 +0100 Subject: [PATCH] AdBlock: Slightly edited behavior of showing menu Don't show blocking options in menu on sites that AdBlock cannot run. eg. qupzilla:, file: --- src/lib/adblock/adblockicon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/adblock/adblockicon.cpp b/src/lib/adblock/adblockicon.cpp index d91d5d288..5e651b80e 100644 --- a/src/lib/adblock/adblockicon.cpp +++ b/src/lib/adblock/adblockicon.cpp @@ -111,7 +111,7 @@ void AdBlockIcon::createMenu(QMenu* menu) menu->addAction(tr("Show AdBlock &Settings"), manager, SLOT(showDialog())); menu->addSeparator(); - if (!pageUrl.isEmpty() && m_enabled) { + if (!pageUrl.host().isEmpty() && m_enabled && manager->canRunOnScheme(pageUrl.scheme())) { const QString &host = page->url().host().contains(QLatin1String("www.")) ? pageUrl.host().mid(4) : pageUrl.host(); const QString &hostFilter = QString("@@||%1^$document").arg(host); const QString &pageFilter = QString("@@|%1|$document").arg(pageUrl.toString());