Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
Update createRequest warning message to indicate a possible solution
Browse files Browse the repository at this point in the history
This change updates the `createRequest` signal on a `disposed`
`NetworkAccessManager` warning message to indicate one more issue that
may be fixed by a user controlled setting. This was discovered by
running with `--log-level debug` which I added in b8f9f5e /
#4668 and seeing the
debug message "Loading done; Stopping QWebPage and any possible page
refreshes." before I expected it to be called (before an API request had
finished). This is called by the `loadFinished` handler
https://github.com/wkhtmltopdf/wkhtmltopdf/blob/5b26acc41d8209d3b4c4018ac7350b8cea64fa73/src/lib/multipageloader.cc#L336-L340
and from that I realized that `loadDone` was being called too early. I
don't believe the immediate `loadDone()` is being called because the
default JavaScript delay is 200ms, but setting the timeout to 5 seconds
fixed the issue for me, and logging this suggestion as a warning may
help someone else when debugging.
  • Loading branch information
terencehonles committed Oct 5, 2021
1 parent 5b26acc commit 861aea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/multipageloader.cc
Expand Up @@ -77,7 +77,8 @@ QNetworkReply * MyNetworkAccessManager::createRequest(Operation op, const QNetwo
if (disposed)
{
emit warning("Received createRequest signal on a disposed ResourceObject's NetworkAccessManager. "
"This might be an indication of an iframe taking too long to load.");
"This might be an indication of an iframe taking too long to load or --javascript-delay ");
"being set too short.");
// Needed to avoid race conditions by spurious network requests
// by scripts or iframes taking too long to load.
QNetworkRequest r2 = req;
Expand Down

0 comments on commit 861aea7

Please sign in to comment.