Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87378

QttWebEngine doesnt block new view request when `request.openIn` is not called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.4
    • 5.15.2
    • WebEngine
    • None
    • Linux/X11
    • bbf7226ace4d9bbcff4d68c063dc598c2d3f2ff0 (qt/qtwebengine/5.15)

    Description

      This issue is an followup to QTBUG-87235(duplicate of QTBUG-85494)
      While the patch solves the segfault (as mentioned in QTBUG-85494), now it is causing another unexpected behaviour.

      Problem : When a new view request is received, if there are no `request.openIn` call made, it forcefully loads the new view in the existing webengineview instead of ignoring the request. Right now there is no way to block a new view request.

      Expected : If there are no `request.openIn` calls, it should block the new view request or maybe there should be `request.accepted` flag to control the behaviour.

      Simple Example :

      test.html

      <html>
          <body>
              <a href="https://google.com">Google</a>
          </body>
      </html>
      
      
      WebEngineView {
          id: webengine
          anchors.fill: parent
          url: "/path/to/test.html"
      
          onNewViewRequested: {
              console.log("New View Requested but cannot ignore request");
          }
      }
      

      Load the test.html page in the WebEngineView and Ctrl+Click the link to reproduce the error

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            ab0027 Anupam Basak
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes