From 7987819415804e5e6c5c79c3a60445aa3c1c8dc6 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 11 Apr 2020 18:37:52 +0100 Subject: [PATCH] Snippets: acceptNavigationRequest: only process NavigationTypeLinkClicked events --- src/qtgui/snippets_w.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qtgui/snippets_w.h b/src/qtgui/snippets_w.h index ce421aac..411e0287 100644 --- a/src/qtgui/snippets_w.h +++ b/src/qtgui/snippets_w.h @@ -74,10 +74,14 @@ public: : QWebEnginePage((QWidget *)parent), m_parent(parent) {} protected: virtual bool acceptNavigationRequest(const QUrl& url, - NavigationType, + NavigationType tp, bool) { - m_parent->onLinkClicked(url); - return false; + if (tp == QWebEnginePage::NavigationTypeLinkClicked) { + m_parent->onLinkClicked(url); + return false; + } else { + return true; + } } private: SnippetsW *m_parent;