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:
parent
2f8c12ff1c
commit
7ebd4039f8
|
@ -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));
|
||||
|
|
|
@ -29,5 +29,6 @@ public:
|
|||
|
||||
private:
|
||||
void webPageCreated(WebPage *page);
|
||||
void webPageDeleted(WebPage *page);
|
||||
void mainWindowCreated(BrowserWindow *window);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user