QWebEngineUrlRequestInterceptor Class
QWebEngineUrlRequestInterceptor クラスは、URL インターセプトの抽象ベースクラスを提供します。詳細...
ヘッダー | #include <QWebEngineUrlRequestInterceptor> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WebEngineCore) target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore) |
qmake: | QT += webenginecore |
継承: | QObject |
パブリック関数
QWebEngineUrlRequestInterceptor(QObject *p = nullptr) | |
virtual void | interceptRequest(QWebEngineUrlRequestInfo &info) = 0 |
詳細な説明
QWebEngineUrlRequestInterceptor インターフェイスを実装し、プロファイルにインターセプターをインストールすることで、URL リクエストが Chromium のネットワーキングスタックに到達する前にインターセプト、ブロック、修正を行うことができます。
インターセプターをプロファイルにインストールするには、QWebEngineProfile::setUrlRequestInterceptor() またはQQuickWebEngineProfile::setUrlRequestInterceptor() を使用します。
Qt WebEngine ウィジェットモジュールを使用する場合、QWebEnginePage::acceptNavigationRequest() はリクエストを受け入れるかブロックするかのオプションを提供します。
interceptRequest() およびQWebEngineUrlRequestInfoも参照して ください。
メンバ関数のドキュメント
[explicit]
QWebEngineUrlRequestInterceptor::QWebEngineUrlRequestInterceptor(QObject *p = nullptr)
p を親とする新しい QWebEngineUrlRequestInterceptor オブジェクトを作成します。
[pure virtual]
void QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
この仮想関数を再実装することで、URLリクエストのインターセプトが可能になる。このメソッドは、処理されるまで URL リクエストをストールします。
info はURLリクエストに関する情報を含み、そのメンバが変更されたかどうかを内部的に追跡します。
警告 メインスレッド上のプロファイルへのすべてのメソッド呼び出しは、この関数の実行が終了するまでブロックされます。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.