/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: git://neueland.iserlohn-fortress.net/smolbote.git * * SPDX-License-Identifier: GPL-3.0 */ #ifndef URLREQUESTINTERCEPTOR_H #define URLREQUESTINTERCEPTOR_H #include class UrlRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: struct HostRule { bool isBlocking; }; explicit UrlRequestInterceptor(const QString &path, QObject *parent = nullptr); ~UrlRequestInterceptor(); void interceptRequest(QWebEngineUrlRequestInfo &info); public slots: int parseHostfile(const QString &filename); private: QHash m_rules; }; #endif // URLREQUESTINTERCEPTOR_H