1 // For license of this file, see <project-root-folder>/LICENSE.md. 2 3 #ifndef WEBPAGE_H 4 #define WEBPAGE_H 5 6 #include <QWebEnginePage> 7 8 class WebViewer; 9 10 class WebPage : public QWebEnginePage { 11 Q_OBJECT 12 13 public: 14 explicit WebPage(QObject* parent = nullptr); 15 16 WebViewer* view() const; 17 18 private slots: 19 void hideUnwantedElements(); 20 21 protected: 22 virtual bool acceptNavigationRequest(const QUrl& url, NavigationType type, bool is_main_frame); 23 virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, 24 int line_number, const QString& source_id); 25 }; 26 27 #endif // WEBPAGE_H 28