Commit 93f9eed6 authored by Viktor Engelmann's avatar Viktor Engelmann Committed by Viktor Engelmann
Browse files

Store Target URL in WebContentsDelegateQt::WebContentsCreated


When opening a new window, for example by using the JavaScript
method window.open('...'), the requested url is not stored
in the content::WebContents object we get in
WebContentsDelegateQt::createWindow (at this point, it should
at least be stored as pending request in the WebContents'
NavigationController, but it is not).

Because of this, the QQuickWebEngineNewViewRequest object
in QQuickWebEngineViewPrivate::adoptNewWindow never contained
the url. We have access to the target url in
WebContentsDelegateQt::WebContentsCreated, so now we store
it there in a new property m_initialTargetUrl, from where
WebContentsDelegateQt::createWindow takes it and passes it
to WebContentsAdapter::adoptNewWindow as a new parameter.

[ChangeLog][WebEngine] Fix WebEngineNewViewRequest::requestedUrl being empty when opening window from JavaScript

Task-number: QTBUG-57675
Change-Id: I7e2c7866899baade17ce2517e6be8b2b2709699e
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
parent 95ca17c4
Showing with 27 additions and 14 deletions
Supports Markdown
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