How to tell QWebPage not to load specific type of resources like js, css or png?
How to tell QWebPage not to load specific type of resources like js, css
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The solution is to extend
QNetworkAccessManagerclass and override it’s virtual methodQNetworkAccessManager::createRequestIn our implementation we check the path of the requested url and if it’s the one we don’t want to download we create and hand over an empty request instead of the real one.Below is a complete, working example.