diff --git a/iframeschemehandler.cpp b/iframeschemehandler.cpp index 63d6d081..a4bf4bd3 100644 --- a/iframeschemehandler.cpp +++ b/iframeschemehandler.cpp @@ -45,6 +45,9 @@ void IframeSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob) QRegularExpression::CaseInsensitiveOption | QRegularExpression::DotMatchesEverythingOption ); QString baseTagHtml = ""; + + QString depressionFocus = + ""; // remove existed base tag articleString.remove( baseTag ) ; @@ -56,12 +59,14 @@ void IframeSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob) if( match.hasMatch() ) { articleString.insert( match.capturedEnd(), baseTagHtml ); + articleString.insert( match.capturedEnd(), depressionFocus ); } else { // the html contain no head element // just insert at the beginning of the html ,and leave it at the mercy of browser(chrome webengine) articleString.insert( 0, baseTagHtml ); + articleString.insert( 0, depressionFocus ); } buffer->setData(codec->fromUnicode(articleString));