2020-04-27 01:17:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2020 Oleg Shparber
|
|
|
|
|
** Copyright (C) 2019 Kay Gawlik
|
|
|
|
|
** Contact: https://go.zealdocs.org/l/contact
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Zeal.
|
|
|
|
|
**
|
|
|
|
|
** Zeal is free software: you can redistribute it and/or modify
|
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
|
|
|
|
** Zeal is distributed in the hope that it will be useful,
|
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
2020-06-29 00:26:14 -04:00
|
|
|
** along with Zeal. If not, see <https://www.gnu.org/licenses/>.
|
2020-04-27 01:17:12 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef ZEAL_BROWSER_WEBPAGE_H
|
|
|
|
|
#define ZEAL_BROWSER_WEBPAGE_H
|
|
|
|
|
|
|
|
|
|
#include <QWebEnginePage>
|
|
|
|
|
|
|
|
|
|
namespace Zeal {
|
|
|
|
|
namespace Browser {
|
|
|
|
|
|
|
|
|
|
class WebPage final : public QWebEnginePage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_DISABLE_COPY(WebPage)
|
|
|
|
|
public:
|
2020-05-10 11:03:02 -04:00
|
|
|
explicit WebPage(QObject *parent = nullptr);
|
2020-04-27 01:17:12 +02:00
|
|
|
|
|
|
|
|
protected:
|
2020-06-14 18:01:09 -04:00
|
|
|
bool acceptNavigationRequest(const QUrl &requestUrl, NavigationType type, bool isMainFrame) override;
|
2020-05-26 00:37:16 -04:00
|
|
|
void javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceId) override;
|
2020-04-27 01:17:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Browser
|
|
|
|
|
} // namespace Zeal
|
|
|
|
|
|
|
|
|
|
#endif // ZEAL_BROWSER_WEBPAGE_H
|