Commit d73ae7e2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Forward url blocked

parent 13204ffb
Pipeline #51847 canceled with stage
......@@ -927,6 +927,11 @@ void ViewerPrivate::initHtmlWidget()
connect(mScamDetectionWarning, &ScamDetectionWarningWidget::messageIsNotAScam, this, &ViewerPrivate::slotMessageIsNotAScam);
connect(mScamDetectionWarning, &ScamDetectionWarningWidget::addToWhiteList, this, &ViewerPrivate::slotAddToWhiteList);
connect(mViewer, &MailWebEngineView::pageIsScrolledToBottom, this, &ViewerPrivate::pageIsScrolledToBottom);
connect(mViewer, &MailWebEngineView::urlBlocked, this, &ViewerPrivate::slotUrlBlocked);
}
void ViewerPrivate::slotUrlBlocked(const QUrl &url)
{
}
void ViewerPrivate::applyZoomValue(qreal factor, bool saveConfig)
......
......@@ -609,6 +609,7 @@ private:
bool mHtmlMailGlobalSetting = false;
bool mHtmlLoadExternalDefaultSetting = false;
bool mHtmlLoadExtOverride = false;
void slotUrlBlocked(const QUrl &url);
public:
KMime::Message::Ptr mMessage; // the current message, if it was set manually
......
......@@ -6,6 +6,7 @@
#include "loadexternalreferencesurlinterceptor.h"
#include <QDebug>
#include <QWebEngineUrlRequestInfo>
using namespace MessageViewer;
......@@ -30,6 +31,7 @@ bool LoadExternalReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequest
} else {
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage && !info.requestUrl().isLocalFile() && (scheme != QLatin1String("cid"))) {
Q_EMIT urlBlocked(info.requestUrl());
qDebug() << " info.requestUrl()" << info.requestUrl();
return true;
} else if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeFontResource) {
return true;
......
......@@ -82,6 +82,7 @@ MailWebEngineView::MailWebEngineView(KActionCollection *ac, QWidget *parent)
d->mNetworkAccessManager = new WebEngineViewer::InterceptorManager(this, ac, this);
d->mExternalReference = new MessageViewer::LoadExternalReferencesUrlInterceptor(this);
connect(d->mExternalReference, &MessageViewer::LoadExternalReferencesUrlInterceptor::urlBlocked, this, &MailWebEngineView::urlBlocked);
d->mNetworkAccessManager->addInterceptor(d->mExternalReference);
auto cidReference = new MessageViewer::CidReferencesUrlInterceptor(this);
d->mNetworkAccessManager->addInterceptor(cidReference);
......
......@@ -81,6 +81,7 @@ protected:
Q_SIGNALS:
void wheelZoomChanged(int numSteps);
void openUrl(const QUrl &url);
void urlBlocked(const QUrl &url);
void messageMayBeAScam();
void formSubmittedForbidden();
void mailTrackingFound(const MessageViewer::BlockMailTrackingUrlInterceptor::MailTrackerBlackList &);
......
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