File indexing completed on 2025-01-26 04:57:25
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QWebEnginePage> 0010 0011 namespace WebEngineViewer 0012 { 0013 class WebEnginePage; 0014 class WebEngineNavigationRequestInterceptor : public QWebEnginePage 0015 { 0016 Q_OBJECT 0017 public: 0018 explicit WebEngineNavigationRequestInterceptor(QWebEnginePage *page); 0019 ~WebEngineNavigationRequestInterceptor() override; 0020 0021 protected: 0022 [[nodiscard]] bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override; 0023 0024 private: 0025 QWebEnginePage *const mTargetPage; 0026 }; 0027 }