#ifndef NAM_H_ #define NAM_H_ #include #include #include /** * Block certain requests based on URL via QtWebEngine interceptor */ class SlxRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: SlxRequestInterceptor(const QRegularExpression& blackList, const QRegularExpression& whiteList, QObject *parent = nullptr) : QWebEngineUrlRequestInterceptor(parent), _black(blackList), _white(whiteList) {} void interceptRequest(QWebEngineUrlRequestInfo &info) override; signals: void urlBlocked(const QUrl &url); void unsupportedScheme(const QUrl &url); private: QRegularExpression _black, _white; }; // no reply subclass needed with WebEngine #endif