#include "ogwebpage.h" #include #include #include "ogcommandline.h" #include "mainwindow.h" #include bool OGWebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) { qInfo() << "Link clicked: URL = " << url << "; type = " << type << "; isMainFrame = " << isMainFrame; if ( type == QWebEnginePage::NavigationType::NavigationTypeLinkClicked) { } return true; } QWebEnginePage *OGWebPage::createWindow(QWebEnginePage::WebWindowType type) { qInfo() << "Create new window: " << type; OGCommandLineOptions &options = OGCommandLineOptions::getInstance(); switch(options.getNewTabBehavior()) { case OGCommandLineOptions::NewTabBehavior::NewTab: qWarning() << "Unimplemented"; return this; case OGCommandLineOptions::NewTabBehavior::ReplacePage: qInfo() << "Replacing page"; return this; case OGCommandLineOptions::NewTabBehavior::Ignore: qInfo() << "Ignoring attempt to open new tab"; return nullptr; } qCritical() << "Unknown new tab behavior, this should be unreachable"; return this; }