Commit e9864d87 authored by Laurent Montel's avatar Laurent Montel
Browse files

Add support for WebEngineViewer::BlockExternalResourcesUrlInterceptor

parent 9b7311b7
Pipeline #56633 canceled with stage
......@@ -37,6 +37,7 @@
#include <QWebEngineUrlRequestInterceptor>
#include <viewerplugintoolmanager.h>
#include <WebEngineViewer/BlockExternalResourcesUrlInterceptor>
#include <WebEngineViewer/BlockTrackingUrlInterceptor>
#include <WebEngineViewer/LoadExternalReferencesUrlInterceptor>
#include <WebEngineViewer/WebEngineScript>
......@@ -91,6 +92,9 @@ ArticleViewerWebEngine::ArticleViewerWebEngine(KActionCollection *ac, QWidget *p
auto *blockTracking = new WebEngineViewer::BlockTrackingUrlInterceptor(this);
connect(blockTracking, &WebEngineViewer::BlockTrackingUrlInterceptor::trackingFound, this, &ArticleViewerWebEngine::trackingFound);
mNetworkAccessManager->addInterceptor(blockTracking);
mBlockExternalReference = new WebEngineViewer::BlockExternalResourcesUrlInterceptor(this);
// TODO connect(mBlockExternalReference, &WebEngineViewer::BlockExternalResourcesUrlInterceptor::formSubmittedForbidden, this,
// &MailWebEngineView::urlBlocked);
#endif
connect(this, &ArticleViewerWebEngine::showContextMenu, this, &ArticleViewerWebEngine::slotShowContextMenu);
......
......@@ -19,6 +19,7 @@ class WebHitTestResult;
class WebEngineAccessKey;
class InterceptorManager;
class LoadExternalReferencesUrlInterceptor;
class BlockExternalResourcesUrlInterceptor;
}
namespace MessageViewer
{
......@@ -126,6 +127,7 @@ protected:
QList<QAction *> viewerPluginActionList(MessageViewer::ViewerPluginInterface::SpecificFeatureTypes features);
WebEngineViewer::InterceptorManager *mNetworkAccessManager = nullptr;
WebEngineViewer::LoadExternalReferencesUrlInterceptor *mExternalReference = nullptr;
WebEngineViewer::BlockExternalResourcesUrlInterceptor *mBlockExternalReference = nullptr;
private:
void openSafeUrl(const QUrl &url);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment