Details
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.