/* * 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: https://neueland.iserlohn-fortress.net/smolbote.hg * * SPDX-License-Identifier: GPL-3.0 */ #ifndef URLREQUESTINTERCEPTOR_H #define URLREQUESTINTERCEPTOR_H #include #include class UrlRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: struct HostRule { bool isBlocking; }; explicit UrlRequestInterceptor(const QString &path, QObject *parent = nullptr); ~UrlRequestInterceptor() override; void interceptRequest(QWebEngineUrlRequestInfo &info) override; private: QHash rules; QMutex rulesLock; }; QHash parse(const QString &filename); #endif // URLREQUESTINTERCEPTOR_H