From 426d7260496090caba24422593f611ef804e8562 Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Thu, 27 Jun 2024 14:04:50 +0800 Subject: [PATCH] opt: suppress url title --- src/ui/articleview.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index 1b58aac40a..9f3cae109b 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -478,7 +478,7 @@ void ArticleView::loadFinished( bool result ) void ArticleView::handleTitleChanged( QString const & title ) { - if ( !title.isEmpty() ) + if ( !title.isEmpty() && !title.contains("://")) emit titleChanged( this, title ); } @@ -1443,7 +1443,10 @@ void ArticleView::setContent( const QByteArray & data, const QString & mimeType, QString ArticleView::getTitle() { - return webview->page()->title(); + auto title = webview->title(); + if(title.contains("://")) + return {}; + return webview->title(); } QString ArticleView::getWord() const