• Viktor Engelmann's avatar
    Store Target URL in WebContentsDelegateQt::WebContentsCreated · 93f9eed6
    Viktor Engelmann authored
    
    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>
    93f9eed6
examples.pro 260 bytes
TEMPLATE=subdirs
qtHaveModule(webengine) {
    SUBDIRS += webengine/quicknanobrowser
qtHaveModule(webenginewidgets) {
    SUBDIRS += \
        webenginewidgets/demobrowser \
        webenginewidgets/fancybrowser \
        webenginewidgets/markdowneditor