IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWebEngineUrlRequestInterceptor Class

The QWebEngineUrlRequestInterceptor class provides an abstract base class for URL interception.

This class was introduced in Qt 5.6.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWebEngineUrlRequestInterceptor Class

  • Header: QWebEngineUrlRequestInterceptor

  • Since: Qt 5.6

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)

    target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)

  • qmake: QT += webenginecore

  • Inherits: QObject

Detailed Description

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::setUrlRequestInterceptor() or QQuickWebEngineProfile::setUrlRequestInterceptor().

When using the Qt WebEngine Widgets Module, QWebEnginePage::acceptNavigationRequest() offers further options to accept or block requests.

See Also

Member Function Documentation

 

[explicit] QWebEngineUrlRequestInterceptor::QWebEngineUrlRequestInterceptor(QObject *p = 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 method will be stalling the URL request until handled.

info contains the information about the URL request and will track internally whether its members have been altered.

All method calls to the profile on the main thread will block until execution of this function is finished.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+