Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Wei-Seattle last edited by
Our application need to execute some JS function from an external JS file. We need to prevent that JS getting data other than a whitelist domain. e.g.
We want to make sure that getYahooData() will only make network requests to www.yahooapi.com domain only.
Is there any way to get that? Thanks a lot!
In the old
QWebViewthere was a way to set custom a
QNetworkAccessManagerwhere in one can re-implement some of its methods to intercept the requests.
If you are using the old version check the following post:
But if are using a latest i.e Qt WebEngine then you will need to update to Qt 5.6 where they have added new API's to do so. As per this doc.
We’ve also added a new Qt WebEngineCore module for new low-level APIs. This includes features such as support for custom URL schemes, intercepting and blocking network requests and for tracking and blocking cookies.