PDA

View Full Version : How do I get all the urls going to be read?



MacAssembly
9th September 2017, 21:44
I'd like to get the URL which is going to be processed by the browser before it's done, the closest I got was acceptNavigationRequest() that works for frames but for something more specific, for example, a image file is going to be read, that method is obviously not called. I found that finished() has those URLS I'm looking for, but it's show when the URL is ready, I want it before it's going to be ready, like acceptNavigationRequest() does.

The closest I got so far was override acceptNavigationRequest():


class webPage : public QWebPage
{
Q_OBJECT

bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
{
qDebug() << "url = " << request.url();
return true;
}

}

Added after 1 44 minutes:

Found the way by overriding QNetworkAccessManager::createRequest()