summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2021-09-30 16:48:04 +0200
committerSzabolcs David <davidsz@inf.u-szeged.hu>2021-10-25 12:31:15 +0200
commit1c8934c8ed1fa0eca96f980cd597c887678f4b14 (patch)
treee61ef54d5f5d7468b3e35c3e0148b9336a437030
parent8c1ef921c064fae6156805ebcd92d1c9954ac085 (diff)
Do not open screencast in DevTools by default
If screencastEnabled preference is not found, ScreencastApp.ts defaults it to true. This happens at the first start of a browser application. Task-number: QTBUG-96942 Pick-to: 6.2 Change-Id: I15788737640cfe07c0016b31fc471906452aad1b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/devtools_frontend_qt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 81701b63..9a773696 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -87,6 +87,8 @@ using namespace QtWebEngineCore;
namespace {
+constexpr char kScreencastEnabled[] = "screencastEnabled";
+
std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpResponseHeaders *rh,
bool success,
int net_error)
@@ -468,6 +470,10 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
m_loaders.insert(std::move(resource_loader));
return;
} else if (method == "getPreferences") {
+ // Screencast is enabled by default if it's not present in the preference store.
+ if (!m_prefStore->GetValue(kScreencastEnabled, NULL))
+ SetPreference(kScreencastEnabled, "false");
+
m_preferences = std::move(*m_prefStore->GetValues());
SendMessageAck(request_id, &m_preferences);
return;