Fix issue with info protocol and refresh
ClosedPublic

Authored by stefanocrocco on Aug 4 2018, 9:17 PM.

Details

Summary

In certain cases, the info ioslave need to redirect to another URL (for instance, info:cp is redirected to info:/coreutils/cp invocation). To do so the ioslave produces an HTML page with a <meta> element having a content-type=refresh attribute which points to the correct URL.

This causes a significant problem with the WebEnginePartHtmlEmbedder: this class uses a QWebEnginePage to parse the HTML, but QWebEnginePage does much more than just parsing the HTML and tries to actually refresh the page. This means that the loadFinished signal is emitted more than once, one for the original code and another for the refresh. Due to everything QWebEnginePage does being asynchronous, this somehow (I couldn't exactly understand what's happening) causes an error message saying that the page doesn't exist (I guess that QWebEnginePage enter a loop which it forcefully breaks after a few iterations).

Disconnecting the QWebEnginePage::loadFinished signal the first time it's emitted and connecting to it again from WebEnginePartHtmlEmbedder::startEmbedding seems to solve the issue (at least most of the times).

Test Plan

enter the info:cp URL and check that the correct page (info:/coreutils/cp invocation) is displayed

Diff Detail

Repository
R226 Konqueror
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
stefanocrocco requested review of this revision.Aug 4 2018, 9:17 PM
stefanocrocco created this revision.
stefanocrocco retitled this revision from Remove useless #include to Fix issue with info protocol and refresh.Aug 4 2018, 9:19 PM
stefanocrocco edited the summary of this revision. (Show Details)
stefanocrocco edited the test plan for this revision. (Show Details)
stefanocrocco added a reviewer: dfaure.
dfaure accepted this revision.Aug 4 2018, 9:22 PM
dfaure added inline comments.
webenginepart/src/webengineparthtmlembedder.h
56

its -> is

honour -> honours

This revision is now accepted and ready to land.Aug 4 2018, 9:22 PM
This revision was automatically updated to reflect the committed changes.