summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 67639dc4f..adf98a3e1 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -114,6 +114,7 @@
#include <QSurfaceFormat>
#include <QVector>
#include <qpa/qplatformnativeinterface.h>
+#include <QNetworkProxy>
using namespace QtWebEngineCore;
@@ -335,6 +336,18 @@ void WebEngineContext::destroyContextPostRoutine()
m_destroyed = true;
}
+ProxyAuthentication WebEngineContext::qProxyNetworkAuthentication(QString host, int port)
+{
+ if (!QNetworkProxyFactory::usesSystemConfiguration()) {
+ QNetworkProxy proxy = QNetworkProxy::applicationProxy();
+ if (host == proxy.hostName() && port == proxy.port() && !proxy.user().isEmpty()
+ && !proxy.password().isEmpty()) {
+ return std::make_tuple(true, proxy.user(), proxy.password());
+ }
+ }
+ return std::make_tuple(false, QString(), QString());
+}
+
#ifndef CHROMIUM_VERSION
#error Chromium version should be defined at gyp-time. Something must have gone wrong
#define CHROMIUM_VERSION // This is solely to keep Qt Creator happy.