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

missing loadFinished after in-page navigation link to fragment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.5, 5.15
    • 5.12.3
    • WebEngine
    • None
    • All
    • 4d4fc9cd120376f30ce0630b1e8c7bf174d44fae (qt/qtwebengine/5.15)

    Description

      If a user clicks on a link that uses a fragment to navigate inside of that page, WebEnginePage generates a loadStarted signal but NO corresponding loadFinished signal.

      This can create problems when trying to determine when it is safe to run javascripts on the page and when it is not. It is also inconsistent.

      A quick check with the signal loadProgress(int progress) shows a 0 immediately followed by 100 but no loadFinished.

      In addition unlike QWebKit which can delegate all links, the recommended use of overriding acceptNavigationRequests() in QWebEnginePage is never invoked for this user "clicked" event to navigate to a local link, preventing its interception.

      We can use loadProgress and test for progress equal to 100% to workaround the problem and send out our own (more reliable) loadFinished signal. But this really should be fixed. There should never be a missing loadFinished if there is a loadStarted. If a load fails it should return a loadFinished with okay as false.

      Also, how do you recommend we detect and intercept requests to navigate inside the page by the user clicking links with #fragment? This does not seem to be achievable using the recommended acceptNavigationRequests.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-76802
          # Subject Branch Project Status CR V

          Activity

            People

              kiburtse Kirill Burtsev
              kevinhendricks Kevin B. Hendricks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes