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

[REG 6.8.0 -> 6.8.1] WebView's loadHtml() with BaseURL has issues loading HTML content.

    XMLWordPrintable

Details

    • Android

    Description

      When loading HTML content with a BaseURL using WebView.loadHtml(), the content doesn't get loaded and displays incorrect content.
      The issue didn't appear in version 6.7.2 and 6.8.0, but it reproduces in versions 6.8.2 and 6.8.1.
      To reproduce the issue, run the attached example project.
      The minibrowser example project was edited, and the following lines have been added to main.qml:

      Component.onCompleted: {
                      goButton.clicked()
                  }            
      ToolButton {
                      id: goButton
                      text: qsTr("Go")
                      onClicked: {
                          Qt.inputMethod.commit()
                          Qt.inputMethod.hide()
                        //  webView.url = utils.fromUserInput(urlField.text)
                        var shtml = "<html><body><p>Hello World!</p></body></html>"
                        webView.loadHtml(shtml, "https://example.com/");
                      }
                  }

      Attachments

        1. minibrowser.zip
          59 kB
          Mehdi Belila
        2. result.jpg
          64 kB
          Mehdi Belila

        Issue Links

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

          Activity

            People

              stromme Christian
              mahdi.belila Mehdi Belila
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change