Commit 0b2fcf21 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/20.04'

parents 7cce2d27 429cdb48
Pipeline #21592 passed with stage
in 18 minutes and 39 seconds
......@@ -52,6 +52,7 @@
#include <KActionMenu>
#include <KCharsets>
#include <QPrintPreviewDialog>
#include <QWebEngineUrlScheme>
#include <QMenu>
#include <KMessageBox>
......@@ -194,6 +195,11 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
+ QByteArray::number(reinterpret_cast<quintptr>(this)), this))
, mPreviouslyViewedItemId(-1)
{
QWebEngineUrlScheme cidScheme("cid");
cidScheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
cidScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
QWebEngineUrlScheme::registerScheme(cidScheme);
if (!mainWindow) {
mMainWindow = aParent;
}
......
......@@ -26,6 +26,7 @@
#include "blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.h"
#include "blockmailtrackingurlinterceptor/blockmailtrackingurlinterceptor.h"
#include "cidreferencesurlinterceptor/cidreferencesurlinterceptor.h"
#include "cidschemehandler/cidschemehandler.h"
#include <WebEngineViewer/InterceptorManager>
#include <WebEngineViewer/WebEngineManageScript>
......@@ -33,6 +34,7 @@
#include "scamdetection/scamcheckshorturl.h"
#include <QContextMenuEvent>
#include <WebEngineViewer/WebHitTest>
#include <QWebEngineProfile>
#include <QPrinter>
......@@ -91,6 +93,8 @@ MailWebEngineView::MailWebEngineView(KActionCollection *ac, QWidget *parent)
&MailWebEngineView::openUrl);
connect(this, &MailWebEngineView::loadFinished, this, &MailWebEngineView::slotLoadFinished);
d->mPageEngine->profile()->installUrlSchemeHandler(QByteArrayLiteral("cid"), new CidSchemeHandler(this));
d->mNetworkAccessManager = new WebEngineViewer::InterceptorManager(this, ac, this);
d->mExternalReference = new MessageViewer::LoadExternalReferencesUrlInterceptor(this);
d->mNetworkAccessManager->addInterceptor(d->mExternalReference);
......
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