Modified: trunk/Tools/MiniBrowser/gtk/main.c (225971 => 225972)
--- trunk/Tools/MiniBrowser/gtk/main.c 2017-12-15 13:58:59 UTC (rev 225971)
+++ trunk/Tools/MiniBrowser/gtk/main.c 2017-12-15 14:27:25 UTC (rev 225972)
@@ -37,6 +37,7 @@
#define MINI_BROWSER_ERROR (miniBrowserErrorQuark())
static const gchar **uriArguments = NULL;
+static const gchar **ignoreHosts = NULL;
static GdkRGBA *backgroundColor;
static gboolean editorMode;
static const char *sessionFile;
@@ -45,6 +46,7 @@
static gboolean automationMode;
static gboolean fullScreen;
static gboolean enableIntelligentTrackingPrevention;
+static const char *proxy;
typedef enum {
MINI_BROWSER_ERROR_INVALID_ABOUT_PATH
@@ -102,6 +104,8 @@
{ "private", 'p', 0, G_OPTION_ARG_NONE, &privateMode, "Run in private browsing mode", NULL },
{ "automation", 0, 0, G_OPTION_ARG_NONE, &automationMode, "Run in automation mode", NULL },
{ "enable-itp", 0, 0, G_OPTION_ARG_NONE, &enableIntelligentTrackingPrevention, "Enable intelligent tracking prevention", NULL },
+ { "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" },
+ { "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
{ 0, 0, 0, 0, 0, 0, 0 }
};
@@ -500,6 +504,12 @@
WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default();
+ if (proxy) {
+ WebKitNetworkProxySettings *webkitProxySettings = webkit_network_proxy_settings_new(proxy, ignoreHosts);
+ webkit_web_context_set_network_proxy_settings(webContext, WEBKIT_NETWORK_PROXY_MODE_CUSTOM, webkitProxySettings);
+ webkit_network_proxy_settings_free(webkitProxySettings);
+ }
+
const gchar *singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS");
webkit_web_context_set_process_model(webContext, (singleprocess && *singleprocess) ?
WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS : WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);