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

Loading html from qrc in QtWebEngine fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.11, 6.5.0 Beta1
    • 6.3, 5.15
    • WebEngine
    • None
    • 84ebd69859 (qt/qtwebengine/dev) 84ebd69859 (qt/tqtc-qtwebengine/dev) 8c149fcbef (qt/qtwebengine/6.3) 903365f84f (qt/qtwebengine/6.4) 3d23b379a7 (qt/qtwebengine/5.15) 3d23b379a7 (qt/tqtc-qtwebengine/5.15) 8c149fcbef (qt/tqtc-qtwebengine/6.3)

    Description

      Attempts to load html files from the qrc scheme fail. If you poke around in dev tools, you get this message upon setting window.location.href to a QRC URL pointing to an HTML file:
      vm404:1 Resource interpreted as Document but transferred with MIME type application/x-extension-html

      This ultimately seems to be the root cause of the issue: a wrong mimetype is detected for .html files in QRC. QMimeDatabase detects the file as application/x-extension-html rather than text/html, reports that to the QrcUrlSchemeHandler, which reports back to the QWebEngineUrlRequestJob, which eventually gets back to Chromium, which sees it got a non-text/html page, and decides it doesn't know what to do with it, rendering nothing.

      Attachments

        Issue Links

          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
              appadeia Carson Black
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes