diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-07 13:20:54 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-07 18:19:19 +0200 |
commit | 2a5ea0269a1f9511c51d661a6c7d7bdc7d0176fa (patch) | |
tree | 7649cf4c1c20bbe8c801d642148992eea314d3ec /src/webengine/urlinterceptor.h | |
parent | Add hint on enabling plugins to makepkg (diff) | |
download | smolbote-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/webengine/urlinterceptor.h')
-rw-r--r-- | src/webengine/urlinterceptor.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/webengine/urlinterceptor.h b/src/webengine/urlinterceptor.h index 575e0c9..420a161 100644 --- a/src/webengine/urlinterceptor.h +++ b/src/webengine/urlinterceptor.h @@ -15,29 +15,21 @@ #include <QWebEngineUrlRequestInterceptor> #include <memory> -typedef std::pair<std::string, std::string> Header; - +class Filter; +class WebProfile; class Configuration; class UrlRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: - struct HostRule { - bool isBlocking; - }; - - explicit UrlRequestInterceptor(const std::unique_ptr<Configuration> &config, QObject *parent = nullptr); + explicit UrlRequestInterceptor(Filter *filter, WebProfile *profile, QObject *parent = nullptr); ~UrlRequestInterceptor() override = default; void interceptRequest(QWebEngineUrlRequestInfo &info) override; private: - QHash<QString, HostRule> rules; - std::vector<FilterRule> filters; - std::vector<Header> m_headers; + Filter *m_filter; + WebProfile *m_profile; }; -QHash<QString, UrlRequestInterceptor::HostRule> parse(const QString &filename); -inline std::vector<FilterRule> parseAdBlockList(const QString &filename); - #endif // SMOLBOTE_URLREQUESTINTERCEPTOR_H |