Changeset 225972 in webkit


Ignore:
Timestamp:
Dec 15, 2017 6:27:25 AM (6 years ago)
Author:
nael.ouedraogo@crf.canon.fr
Message:

[GTK] Add proxy option to Minibrowser
https://bugs.webkit.org/show_bug.cgi?id=180750

Reviewed by Michael Catanzaro.

Add command line option to set proxy settings in GTK minibrowser.

  • MiniBrowser/gtk/main.c:

(main):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r225959 r225972  
     12017-12-15  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
     2
     3        [GTK] Add proxy option to Minibrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=180750
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Add command line option to set proxy settings in GTK minibrowser.
     9
     10        * MiniBrowser/gtk/main.c:
     11        (main):
     12
    1132017-12-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
    214
  • trunk/Tools/MiniBrowser/gtk/main.c

    r222967 r225972  
    3838
    3939static const gchar **uriArguments = NULL;
     40static const gchar **ignoreHosts = NULL;
    4041static GdkRGBA *backgroundColor;
    4142static gboolean editorMode;
     
    4647static gboolean fullScreen;
    4748static gboolean enableIntelligentTrackingPrevention;
     49static const char *proxy;
    4850
    4951typedef enum {
     
    103105    { "automation", 0, 0, G_OPTION_ARG_NONE, &automationMode, "Run in automation mode", NULL },
    104106    { "enable-itp", 0, 0, G_OPTION_ARG_NONE, &enableIntelligentTrackingPrevention, "Enable intelligent tracking prevention", NULL },
     107    { "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" },
     108    { "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
    105109    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
    106110    { 0, 0, 0, 0, 0, 0, 0 }
     
    501505    WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default();
    502506
     507    if (proxy) {
     508        WebKitNetworkProxySettings *webkitProxySettings = webkit_network_proxy_settings_new(proxy, ignoreHosts);
     509        webkit_web_context_set_network_proxy_settings(webContext, WEBKIT_NETWORK_PROXY_MODE_CUSTOM, webkitProxySettings);
     510        webkit_network_proxy_settings_free(webkitProxySettings);
     511    }
     512
    503513    const gchar *singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS");
    504514    webkit_web_context_set_process_model(webContext, (singleprocess && *singleprocess) ?
Note: See TracChangeset for help on using the changeset viewer.