aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/urlinterceptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/urlinterceptor.h')
-rw-r--r--src/webengine/urlinterceptor.h18
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