Details
Description
If I visit a URL which returns an HTTP error with no body, and there exists a user script which modifies DOM at DocumentReady, like this:
-
WebEngineScript {
injectionPoint: WebEngineScript.DocumentReady,
sourceCode: `document.body.innerHTML +=
'<img src="https://http.cat/503" />';`
}
Then it will cause the loadingChanged's argument to has a status of WebEngineView.LoadStoppedStatus and error code of 0, instead of WebEngineView.LoadFailedStatus and error code of HTTP error.
This seems to happen because Chromium 87's go-to-error-page handling seems to be run after DocumentReady signal, which allows the script to prolong Chromium's DidFinishLoad by the mean of remaining blocking content.
This doesn't seem to happen in QtWebEngine 6.2+, seemingly because Chromium 88+ changed the handling of go-to-error-page, resulting in this script not being run [1].
A minimum reproducer is attached.
[1] https://github.com/chromium/chromium/commit/ba3eecbf23feeea636e323dbd0e91e7a54e87263