summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2020-10-14 14:56:47 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-10 11:02:57 +0100
commitbbf7226ace4d9bbcff4d68c063dc598c2d3f2ff0 (patch)
tree922e100467cc80f1dd6d794b07a35c12cf314bee /src/webenginewidgets
parentf93900ec2e5e4289f562b630821650f7c3f8f906 (diff)
Fix new view request handling
Ignore url loading if the request is not from a data url and the Q(Quick)WebEngineNewViewRequest.openIn() is not called on newViewRequested(). Set the missing Q(Quick)WebEngineNewViewRequest::requestedUrl property. Fixes: QTBUG-87378 Change-Id: Idddc9cf075db68dcf5825b3e746d16419d02cfa0 Reviewed-by: Tamas Zakor <ztamas@inf.u-szeged.hu> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 6fb3c5c43..828a1ca79 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -337,8 +337,13 @@ QWebEnginePagePrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebC
Q_UNUSED(targetUrl);
QWebEnginePage *newPage = q->createWindow(toWindowType(disposition));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (!newPage)
return nullptr;
+#else
+ if (!newPage)
+ return adapter;
+#endif
if (!newWebContents->webContents())
return newPage->d_func()->adapter; // Reuse existing adapter