diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index f072c40..539db41 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -129,6 +129,7 @@ void SearchDetailView::setWebWidget(const QString& keyword) } } else { m_webView = new QWebEngineView(this); + m_engineProfile = m_webView->page()->profile(); m_webView->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); m_webView->setAttribute(Qt::WA_DeleteOnClose); m_webView->move(0, 0); @@ -136,11 +137,12 @@ void SearchDetailView::setWebWidget(const QString& keyword) connect(m_webView,&QWebEngineView::loadFinished, this, [ = ](){ m_reload = true; + if (m_engineProfile) m_engineProfile->clearHttpCache(); }); connect(m_webView, &QWebEngineView::urlChanged, this, [ = ](const QUrl& url) { if (m_reload) { - closeWebWidget(); QDesktopServices::openUrl(url); + closeWebWidget(); } }); } diff --git a/src/control/search-detail-view.h b/src/control/search-detail-view.h index 00ceab3..d373f16 100644 --- a/src/control/search-detail-view.h +++ b/src/control/search-detail-view.h @@ -24,7 +24,7 @@ #include #include #include -//#include +#include //#include #include #include "option-view.h" @@ -91,6 +91,7 @@ private: OptionView * m_optionView = nullptr; QWebEngineView * m_webView = nullptr; + QWebEngineProfile * m_engineProfile = nullptr; bool m_reload = false; QString m_currentKeyword;