Messagelib

blockexternalresourcesurlinterceptor.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#pragma once
7
8#include "webengineviewer_export.h"
9#include <QUrl>
10#include <QWebEngineUrlRequestInfo>
11#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
12namespace WebEngineViewer
13{
14class WEBENGINEVIEWER_EXPORT BlockExternalResourcesUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
15{
16 Q_OBJECT
17public:
18 explicit BlockExternalResourcesUrlInterceptor(QObject *parent = nullptr);
19 ~BlockExternalResourcesUrlInterceptor() override;
20
21 [[nodiscard]] bool interceptRequest(QWebEngineUrlRequestInfo &info) override;
22 // Used by autotest only
23 [[nodiscard]] bool
24 interceptRequest(const QUrl &url, QWebEngineUrlRequestInfo::ResourceType resourceType, QWebEngineUrlRequestInfo::NavigationType navigationType);
25 void setEnabled(bool enabled);
26Q_SIGNALS:
27 void formSubmittedForbidden();
28
29private:
30 bool mEnabled = true;
31};
32}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.