1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

AdBlock: Clear blocked requests for url when webpage is deleted

This commit is contained in:
David Rosca 2018-01-06 18:48:15 +01:00
parent 2f8c12ff1c
commit 7ebd4039f8
2 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,7 @@ AdBlockPlugin::AdBlockPlugin(QObject *parent)
{
connect(mApp, &MainApplication::aboutToQuit, AdBlockManager::instance(), &AdBlockManager::save);
connect(mApp->plugins(), &PluginProxy::webPageCreated, this, &AdBlockPlugin::webPageCreated);
connect(mApp->plugins(), &PluginProxy::webPageDeleted, this, &AdBlockPlugin::webPageDeleted);
connect(mApp->plugins(), &PluginProxy::mainWindowCreated, this, &AdBlockPlugin::mainWindowCreated);
}
@ -55,6 +56,11 @@ void AdBlockPlugin::webPageCreated(WebPage *page)
});
}
void AdBlockPlugin::webPageDeleted(WebPage *page)
{
AdBlockManager::instance()->clearBlockedRequestsForUrl(page->url());
}
void AdBlockPlugin::mainWindowCreated(BrowserWindow *window)
{
window->navigationBar()->addToolButton(new AdBlockIcon(window));

View File

@ -29,5 +29,6 @@ public:
private:
void webPageCreated(WebPage *page);
void webPageDeleted(WebPage *page);
void mainWindowCreated(BrowserWindow *window);
};