QWebEngineUrlRequestInterceptor Class
The QWebEngineUrlRequestInterceptor class provides an abstract base class for URL interception. 更多...
头文件: | #include <QWebEngineUrlRequestInterceptor> |
开始支持版本: | Qt 5.6 |
基类: | QObject |
公有函数
QWebEngineUrlRequestInterceptor(QObject *p = Q_NULLPTR) | |
virtual void | interceptRequest(QWebEngineUrlRequestInfo &info) = 0 |
- 32 个公有函数继承自 QObject
其他继承的成员
- 1 个属性继承自 QObject
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
The QWebEngineUrlRequestInterceptor class provides an abstract base class for URL interception.
Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on the profile enables intercepting, blocking, and modifying URL requests before they reach the networking stack of Chromium.
You can install the interceptor on a profile via QWebEngineProfile::setRequestInterceptor() or QQuickWebEngineProfile::setRequestInterceptor().
When using the Qt WebEngine Widgets Module, QWebEnginePage::acceptNavigationRequest() offers further options to accept or block requests.
参见 interceptRequest() and QWebEngineUrlRequestInfo.
成员函数
QWebEngineUrlRequestInterceptor::QWebEngineUrlRequestInterceptor(QObject *p = Q_NULLPTR)
Creates a new QWebEngineUrlRequestInterceptor object with p as parent.
[pure virtual]
void QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
Reimplementing this virtual function makes it possible to intercept URL requests. This function is executed on the IO thread, and therefore running long tasks here will block networking.
info contains the information about the URL request and will track internally whether its members have been altered.