1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-13 10:32:11 +01:00

WebInspector: Don't show inspector actions when JavaScript is disabled

WebInspector doesn't work without JavaScript.
This commit is contained in:
David Rosca 2017-12-30 11:22:45 +01:00
parent 8fd47fe27d
commit 7cd86e144b

View File

@ -24,6 +24,7 @@
#include <QJsonObject> #include <QJsonObject>
#include <QJsonDocument> #include <QJsonDocument>
#include <QNetworkReply> #include <QNetworkReply>
#include <QWebEngineSettings>
QList<QWebEngineView*> WebInspector::s_views; QList<QWebEngineView*> WebInspector::s_views;
@ -85,7 +86,13 @@ void WebInspector::inspectElement()
bool WebInspector::isEnabled() bool WebInspector::isEnabled()
{ {
return qEnvironmentVariableIsSet("QTWEBENGINE_REMOTE_DEBUGGING"); if (!qEnvironmentVariableIsSet("QTWEBENGINE_REMOTE_DEBUGGING")) {
return false;
}
if (!QWebEngineSettings::defaultSettings()->testAttribute(QWebEngineSettings::JavascriptEnabled)) {
return false;
}
return true;
} }
void WebInspector::pushView(QWebEngineView *view) void WebInspector::pushView(QWebEngineView *view)