Changeset 231637 in webkit
- Timestamp:
- May 10, 2018, 1:37:37 AM (8 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
MiniBrowser/gtk/main.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r231625 r231637 1 2018-05-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add support for settings cookies policy and storage type in MiniBrowser 4 https://bugs.webkit.org/show_bug.cgi?id=185506 5 6 Reviewed by Philippe Normand. 7 8 Useful for testing and debugging. 9 10 * MiniBrowser/gtk/main.c: 11 (main): 12 1 13 2018-05-09 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Tools/MiniBrowser/gtk/main.c
r229799 r231637 47 47 static gboolean fullScreen; 48 48 static gboolean enableIntelligentTrackingPrevention; 49 static const char *cookiesFile; 50 static const char *cookiesPolicy; 49 51 static const char *proxy; 50 52 … … 105 107 { "automation", 0, 0, G_OPTION_ARG_NONE, &automationMode, "Run in automation mode", NULL }, 106 108 { "enable-itp", 0, 0, G_OPTION_ARG_NONE, &enableIntelligentTrackingPrevention, "Enable intelligent tracking prevention", NULL }, 109 { "cookies-file", 'c', 0, G_OPTION_ARG_FILENAME, &cookiesFile, "Persistent cookie storage database file", "FILE" }, 110 { "cookies-policy", 0, 0, G_OPTION_ARG_STRING, &cookiesPolicy, "Cookies accept policy (always, never, no-third-party). Default: no-third-party", "POLICY" }, 107 111 { "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" }, 108 112 { "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" }, … … 497 501 WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default(); 498 502 503 if (cookiesPolicy) { 504 WebKitCookieManager *cookieManager = webkit_web_context_get_cookie_manager(webContext); 505 GEnumClass *enumClass = g_type_class_ref(WEBKIT_TYPE_COOKIE_ACCEPT_POLICY); 506 GEnumValue *enumValue = g_enum_get_value_by_nick(enumClass, cookiesPolicy); 507 if (enumValue) 508 webkit_cookie_manager_set_accept_policy(cookieManager, enumValue->value); 509 g_type_class_unref(enumClass); 510 } 511 512 if (cookiesFile && !webkit_web_context_is_ephemeral(webContext)) { 513 WebKitCookieManager *cookieManager = webkit_web_context_get_cookie_manager(webContext); 514 WebKitCookiePersistentStorage storageType = g_str_has_suffix(cookiesFile, ".txt") ? WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT : WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE; 515 webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); 516 } 517 499 518 if (proxy) { 500 519 WebKitNetworkProxySettings *webkitProxySettings = webkit_network_proxy_settings_new(proxy, ignoreHosts);
Note:
See TracChangeset
for help on using the changeset viewer.