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

Blocking main frame request from a Google Search crashes the process

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.8.1, 6.9.0 FF
    • 6.7.3
    • WebEngine
    • None
    • Linux/X11
    • 474132e4d (dev), 2d20cd010 (6.8)

    Description

      In simplebrowser example add the following code:

      class Interceptor : public QWebEngineUrlRequestInterceptor {
      
      public:
        void interceptRequest(QWebEngineUrlRequestInfo &info) override {
            if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
                if (info.requestUrl().host().endsWith("qt.io")) {
                    info.block(true);
                }
            }
        }
      };

      And install the interceptor on the WebPage.

      When running the modified simplebrowser, it is not possible to visit qt.io as we get "ERR_BLOCKED_BY_CLIENT", as expected.

      However, if we first visit google.com and search for qt.io, then click on any result that will open qt.io, it will crash the simplebrowser process.

      Notes

      When it crashes the firstPartyUrl is "https://www.google.com/search?q=qt.io&..."
      while when navigating from any other page the firstPartyUrl is "https://www.qt.io/"

      The underlying root cause might be the same as why https://codereview.qt-project.org/c/qt/qtwebengine/+/391497 was needed.

      Attachments

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

        Activity

          People

            anualiyas Anu Aliyas
            bterrier Benjamin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes