Details
Description
In QQuickWebEngineView, when you open a new window from JavaScript, the newViewRequested signal gives you a QQuickWebEngineNewViewRequest instance with an empty requestedUrl.
Example:
QUrl url("data:text/html,<html><body>test</body></html>"); QQuickWebEngineView *view = new QQuickWebEngineView(); connect(view, &QQuickWebEngineView::newViewRequested, this, [this, url](QQuickWebEngineNewViewRequest *request){ qDebug() << "Expected " << url; qDebug() << "Received " << request->requestedUrl(); }); view->loadHtml("<html><script>window.open('" + url.toString() + "');</script></html>"); QSignalSpy spy(view, &QQuickWebEngineView::newViewRequested); spy.wait(); delete view;
The example prints
Expected QUrl("data:text/html,%3Chtml%3E%3Cbody%3Etest%3C/body%3E%3C/html%3E")
Received QUrl("")