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

Android Webview fails to load all html string because it is percent-encoded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.10.0 Beta3, 6.11.0 FF
    • 6.9.0
    • WebView
    • None
    • Qt 6.9.0 Android arm64
    • Android
    • a8629dd5f (dev), 273fb06d6 (6.10)

      This example fails to load on android

      WebView {
          Component.onCompleted: loadHtml("<html><body>Hello</body></html>", "https://example.com") 
      } 

       and displays the following percent encoded string of the same html 

      "%3Chtml%3E%0A%3Cbody%3E%0AHello%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E"

       

      While digging into this, I found, that the html content is QUrl::toPercentEncoding(html) encoded and all the html tags are stripped away.

      The offending commit is https://github.com/qt/qtwebview/commit/9feccda3138fe0d6c88bf8ba99eb4b57965e95a6

      Why someone wrote this line and pushed it to production is beyond my comprehension.

      As of now Android WebView in 6.9.0 is useless for loading simple html content.

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

            michal Michal Klocek
            elendilm Muhammed Muneer
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are 2 open Gerrit changes