Details
Description
During a port of Sigil to use WebEngine, we found that asynchronous loading of pages happens quite differently in WebEngine than in WebKit when acceptNavigationRequest is overridden in QWebEnginePage. Overriding acceptNavigationRequest is used because the DelegateAllRequests QWebSettings equivalent is not available in WebEngine.
It seems under WebEngine, clicking a link will actually emit the loadStarted signal from QWebEnginePage *BEFORE* the acceptNavigationRequest override is invoked.
If that routine decides to delegate certain links and returns false for them in acceptNavigationRequest a loadFinished(okay=FALSE) is then emitted even though no load request was approved and no error was generated.
Perhaps loadStarted should be emitted only when loadCommitted is generated? Or not emitted unless or until acceptNavigationRequest returns true for that request.
These extra loadStarted() and LoadFinished(false) signals can confuse code that was designed to work originally with WebKit.
This is especially a problem if a signal is emitted in acceptNavigationRequest which can send control to other places leaving the QWebEnginePage in a strange state and can also result in recursive loads attempted depending on the sequence of event processing.
So at the very least, since overriding acceptNavigationRequests is promoted as a way to handle link delegation, please document in your porting documents that QWebEnginePage::acceptNavigationRequests has already started the loading process and emitted loadStarted() BEFORE the request is ever accepted or rejected, and that a follow-up loadFinished(false) is to be expected as a result of link delegation.
Attachments
Issue Links
- is duplicated by
-
QTBUG-66661 loadFinished(False) is emitted with downloads and media files
- Closed