diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 34634f40d..56e227f5c 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -941,6 +941,10 @@ void MainApplication::loadSettings() webSettings->setUnknownUrlSchemePolicy(QWebEngineSettings::AllowAllUnknownUrlSchemes); #endif +#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 12, 0) + webSettings->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, settings.value(QSL("DNSPrefetch"), true).toBool()); +#endif + webSettings->setDefaultTextEncoding(settings.value(QSL("DefaultEncoding"), webSettings->defaultTextEncoding()).toString()); setWheelScrollLines(settings.value(QSL("wheelScrollLines"), wheelScrollLines()).toInt()); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index a9ea27f94..8b1b6aa5c 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -116,6 +116,10 @@ Preferences::Preferences(BrowserWindow* window) ui->webRTCPublicIpOnly->setVisible(false); #endif +#if QTWEBENGINEWIDGETS_VERSION < QT_VERSION_CHECK(5, 12, 0) + ui->dnsPrefetech->setVisible(false); +#endif + auto setCategoryIcon = [this](int index, const QIcon &icon) { ui->listWidget->item(index)->setIcon(QIcon(icon.pixmap(32))); }; @@ -288,6 +292,7 @@ Preferences::Preferences(BrowserWindow* window) ui->useNativeScrollbars->setChecked(settings.value("UseNativeScrollbars", false).toBool()); ui->disableVideoAutoPlay->setChecked(settings.value("DisableVideoAutoPlay", false).toBool()); ui->webRTCPublicIpOnly->setChecked(settings.value("WebRTCPublicIpOnly", true).toBool()); + ui->dnsPrefetch->setChecked(settings.value("DNSPrefetch", true).toBool()); foreach (int level, WebView::zoomLevels()) { ui->defaultZoomLevel->addItem(QString("%1%").arg(level)); @@ -943,6 +948,7 @@ void Preferences::saveSettings() settings.setValue("UseNativeScrollbars", ui->useNativeScrollbars->isChecked()); settings.setValue("DisableVideoAutoPlay", ui->disableVideoAutoPlay->isChecked()); settings.setValue("WebRTCPublicIpOnly", ui->webRTCPublicIpOnly->isChecked()); + settings.setValue("DNSPrefetch", ui->dnsPrefetch->isChecked()); #ifdef Q_OS_WIN settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked()); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 45417bf63..c20143f22 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -1075,6 +1075,13 @@ + + + + Enable DNS prefetching + + + @@ -2394,7 +2401,7 @@ 0 0 96 - 31 + 28