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

QWebEngine does not load qrc: urls on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.2.4, 6.3.0
    • Network: HTTP, WebEngine
    • None
    • Linux/X11

    Description

      On Linux (Ubuntu), WebEngine fails to load an html page that uses a qrc: scheme. This works in 5.15.

      Included in this bug report is a qmake project demonstrating the bug and a workaround.

      The project installs two custom scheme handlers as well:

      p4qrc: This scheme handler returns the contents using QFile a QMimeDatabase

      p4qrc2: This scheme handler is the same, but doesn't use QMimeDatabase for resources with .html as their extension and instead always returns text/html.

      The project runs 5 tests:

      1. Try to load the index page using a resource path and QFile
      2. Try to load the index page using QNetworkRequest an QUrl (with a qrc: scheme)
      3. Try to load the index page using a qrc: scheme
      4. Try to load the index page using a p4qrc: scheme
      5. Try to load the index page using a p4qrc2: scheme

      On Linux with Qt6, loading a qrc: scheme fails. Loading a p4qrc: scheme also fails because the returned mime-type application/x-extension-html isn't accepted by WebEnigne. Loading a p4qrc2: scheme finally passes because it passes a the mime-type that WebEngine recognizes.

      It's possible that the underlying problem isn't a WebEngine problem at all, but rather a QMimeDatabase problem.

      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
            mbishop Michael Bishop
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes