diff --git a/src/plugins/GreaseMonkey/gm_plugin.cpp b/src/plugins/GreaseMonkey/gm_plugin.cpp --- a/src/plugins/GreaseMonkey/gm_plugin.cpp +++ b/src/plugins/GreaseMonkey/gm_plugin.cpp @@ -25,6 +25,8 @@ #include "webtab.h" #include "../config.h" +#include + GM_Plugin::GM_Plugin() : QObject() , m_manager(0) @@ -69,7 +71,13 @@ Q_UNUSED(page) Q_UNUSED(isMainFrame) - if (type == QWebEnginePage::NavigationTypeLinkClicked && url.toString().endsWith(QLatin1String(".user.js"))) { +#if QTWEBENGINE_VERSION >= QT_VERSION_CHECK(5, 14, 0) + bool navigationType = type == QWebEnginePage::NavigationTypeLinkClicked || type == QWebEnginePage::NavigationTypeRedirect; +#else + bool navigationType = type == QWebEnginePage::NavigationTypeLinkClicked; +#endif + + if (navigationType && url.toString().endsWith(QLatin1String(".user.js"))) { m_manager->downloadScript(url); return false; }