From c7c19a4ffc0e775426db09ae62bebf741dbaac23 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Tue, 30 Oct 2018 02:08:15 +0200 Subject: [PATCH] Enable developer extras when WEBKIT_INSPECTOR_SERVER is defined It does make sense to enable the developer extras when the WEBKIT_INSPECTOR_SERVER environment variable has been set. Related issue: WebPlatformForEmbedded/WPEWebKit#549 --- launcher/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/launcher/main.cpp b/launcher/main.cpp index e55505b..61f820e 100644 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -143,6 +143,12 @@ int main(int argc, char* argv[]) if (!g_getenv("WPE_SHELL_DISABLE_CONSOLE_LOG")) WKPreferencesSetLogsPageMessagesToSystemConsoleEnabled(preferences, true); + if (const char* value = g_getenv("WEBKIT_INSPECTOR_SERVER")) { + // Very naïve check for : + if (strlen(value) > 2 && strchr(value, ':')) + WKPreferencesSetDeveloperExtrasEnabled(preferences, true); + } + WKPageGroupSetPreferences(pageGroup, preferences); auto pageConfiguration = WKPageConfigurationCreate();