QWebEngineUrlRequestInterceptor Class

QWebEngineUrlRequestInterceptor 클래스는 URL 가로채기를 위한 추상 베이스 클래스를 제공합니다. 더 보기...

Header: #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 요청이 크롬의 네트워킹 스택에 도달하기 전에 가로채고, 차단하고, 수정할 수 있습니다.

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.