1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

WebPage: Force enable JavaScript for all non http/https urls

This commit is contained in:
David Rosca 2018-01-09 14:19:02 +01:00
parent 287631d37b
commit 675bc0514f

View File

@ -377,7 +377,15 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
return false;
}
return QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame);
const bool result = QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame);
if (result && isMainFrame) {
const bool isWeb = url.scheme() == QL1S("http") || url.scheme() == QL1S("https");
const bool globalJsEnabled = mApp->webSettings()->testAttribute(QWebEngineSettings::JavascriptEnabled);
settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, isWeb ? globalJsEnabled : true);
}
return result;
}
bool WebPage::certificateError(const QWebEngineCertificateError &error)