Diff
Modified: trunk/Tools/ChangeLog (249002 => 249003)
--- trunk/Tools/ChangeLog 2019-08-22 11:05:50 UTC (rev 249002)
+++ trunk/Tools/ChangeLog 2019-08-22 11:18:58 UTC (rev 249003)
@@ -1,3 +1,19 @@
+2019-08-22 Carlos Alberto Lopez Perez <[email protected]>
+
+ [GTK][WPE] Support for command "--version" on the MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=200978
+
+ Reviewed by Žan Doberšek.
+
+ Printing the engine version used from the MiniBrowser is useful.
+ For example, the test scripts on WPT can use this info to better
+ tag the generated results.
+
+ * MiniBrowser/gtk/main.c: Print the engine version when called with --version or -v.
+ (main):
+ * MiniBrowser/wpe/main.cpp: Ditto.
+ (main):
+
2019-08-22 Youenn Fablet <[email protected]>
Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
Modified: trunk/Tools/MiniBrowser/gtk/main.c (249002 => 249003)
--- trunk/Tools/MiniBrowser/gtk/main.c 2019-08-22 11:05:50 UTC (rev 249002)
+++ trunk/Tools/MiniBrowser/gtk/main.c 2019-08-22 11:18:58 UTC (rev 249003)
@@ -53,6 +53,7 @@
static const char *cookiesPolicy;
static const char *proxy;
static gboolean darkMode;
+static gboolean printVersion;
typedef enum {
MINI_BROWSER_ERROR_INVALID_ABOUT_PATH
@@ -116,6 +117,7 @@
{ "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
{ "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", NULL },
{ "content-filter", 0, 0, G_OPTION_ARG_FILENAME, &contentFilter, "JSON with content filtering rules", "FILE" },
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WebKitGTK version", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
{ 0, 0, 0, 0, 0, 0, 0 }
};
@@ -518,6 +520,14 @@
}
g_option_context_free (context);
+ if (printVersion) {
+ g_print("WebKitGTK %d.%d.%d\n",
+ webkit_get_major_version(),
+ webkit_get_minor_version(),
+ webkit_get_micro_version());
+ return 0;
+ }
+
WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default();
if (cookiesPolicy) {
Modified: trunk/Tools/MiniBrowser/wpe/main.cpp (249002 => 249003)
--- trunk/Tools/MiniBrowser/wpe/main.cpp 2019-08-22 11:05:50 UTC (rev 249002)
+++ trunk/Tools/MiniBrowser/wpe/main.cpp 2019-08-22 11:18:58 UTC (rev 249003)
@@ -48,6 +48,7 @@
static const char* cookiesPolicy;
static const char* proxy;
const char* bgColor;
+static gboolean printVersion;
static const GOptionEntry commandLineOptions[] =
{
@@ -61,6 +62,7 @@
{ "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", nullptr },
{ "content-filter", 0, 0, G_OPTION_ARG_FILENAME, &contentFilter, "JSON with content filtering rules", "FILE" },
{ "bg-color", 0, 0, G_OPTION_ARG_STRING, &bgColor, "Window background color. Default: white", "COLOR" },
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },
{ nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }
};
@@ -167,6 +169,14 @@
}
g_option_context_free(context);
+ if (printVersion) {
+ g_print("WPE WebKit %d.%d.%d\n",
+ webkit_get_major_version(),
+ webkit_get_minor_version(),
+ webkit_get_micro_version());
+ return 0;
+ }
+
auto* loop = g_main_loop_new(nullptr, FALSE);
auto backend = createViewBackend(1280, 720);