1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

AdBlock: Slightly edited behavior of showing menu

Don't show blocking options in menu on sites that AdBlock
cannot run.
eg. qupzilla:, file:
This commit is contained in:
nowrep 2012-12-22 12:14:55 +01:00
parent d80990fd50
commit 2f764f0a25

View File

@ -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());