aboutsummaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-07 13:20:54 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-07 18:19:19 +0200
commit2a5ea0269a1f9511c51d661a6c7d7bdc7d0176fa (patch)
tree7649cf4c1c20bbe8c801d642148992eea314d3ec /src/browser.cpp
parentAdd hint on enabling plugins to makepkg (diff)
downloadsmolbote-2a5ea0269a1f9511c51d661a6c7d7bdc7d0176fa.tar.xz
Expand HTTP header settings #4
- add doc/Usage/Filter.asciidoc to explain the usage of the filter headers - add HTTP headers to Profile (section "headers") - Use request interceptor to apply filter headers, then profile headers - add insert/delete actions to ProfileEditor
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 7bf4adf..7295b56 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -27,6 +27,7 @@
#include <version.h>
#include <web/profilemanager.h>
#include <web/webprofile.h>
+#include "webengine/filter.h"
Browser::Browser(int &argc, char *argv[], bool allowSecondary)
: SingleApplication(argc, argv, allowSecondary, SingleApplication::User | SingleApplication::SecondaryNotification | SingleApplication::ExcludeAppVersion)
@@ -58,7 +59,8 @@ QPair<QString, WebProfile *> Browser::loadProfile(const QString &id)
{
WebProfile *profile = m_profileManager->loadProfile(id);
connect(profile, &WebProfile::downloadRequested, m_downloads.get(), &DownloadsWidget::addDownload);
- profile->setRequestInterceptor(m_urlFilter.get());
+ auto *interceptor = new UrlRequestInterceptor(m_urlFilter.get(), profile, profile);
+ profile->setRequestInterceptor(interceptor);
return QPair<QString, WebProfile *>(m_profileManager->id(profile), profile);
}
@@ -107,7 +109,7 @@ void Browser::setup()
// downloads
m_downloads = std::make_unique<DownloadsWidget>(m_config->value<QString>("downloads.path").value());
// url request filter
- m_urlFilter = std::make_unique<UrlRequestInterceptor>(m_config);
+ m_urlFilter = std::make_unique<Filter>(m_config);
// cookie request filter
// load profiles