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:
parent
d80990fd50
commit
2f764f0a25
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user