do not fetch some resources when they are not enabled
This commit is contained in:
parent
5e2cfbd778
commit
871c92c1b6
@ -433,6 +433,7 @@ void TextBrowserViewer::onAnchorClicked(const QUrl& url) {
|
||||
void TextBrowserViewer::setHtml(const QString& html, const QUrl& base_url) {
|
||||
setVerticalScrollBarPosition(0.0);
|
||||
|
||||
if (m_resourcesEnabled) {
|
||||
static QRegularExpression img_tag_rgx("\\<img[^\\>]*src\\s*=\\s*[\"\']([^\"\']*)[\"\'][^\\>]*\\>",
|
||||
QRegularExpression::PatternOption::CaseInsensitiveOption |
|
||||
QRegularExpression::PatternOption::InvertedGreedinessOption);
|
||||
@ -455,6 +456,10 @@ void TextBrowserViewer::setHtml(const QString& html, const QUrl& base_url) {
|
||||
.toStdList();
|
||||
|
||||
m_neededResources = FROM_STD_LIST(QList<QUrl>, really_needed_resources);
|
||||
}
|
||||
else {
|
||||
m_neededResources = {};
|
||||
}
|
||||
|
||||
setHtmlPrivate(html, base_url);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user