WebKit Bugzilla
Attachment 340074 Details for
Bug 185506
: [GTK] Add support for settings cookies policy and storage type in MiniBrowser
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
mb-cookies.diff (text/plain), 3.28 KB, created by
Carlos Garcia Campos
on 2018-05-09 23:42:26 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2018-05-09 23:42:26 PDT
Size:
3.28 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 5e602effd4c..159a1aa2272 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-09 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK] Add support for settings cookies policy and storage type in MiniBrowser >+ https://bugs.webkit.org/show_bug.cgi?id=185506 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Useful for testing and debugging. >+ >+ * MiniBrowser/gtk/main.c: >+ (main): >+ > 2018-05-09 Chris Dumez <cdumez@apple.com> > > Unreviewed Windows build fix after r231622. >diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c >index 881602ef10c..8c8cc2978fa 100644 >--- a/Tools/MiniBrowser/gtk/main.c >+++ b/Tools/MiniBrowser/gtk/main.c >@@ -46,6 +46,8 @@ static gboolean privateMode; > static gboolean automationMode; > static gboolean fullScreen; > static gboolean enableIntelligentTrackingPrevention; >+static const char *cookiesFile; >+static const char *cookiesPolicy; > static const char *proxy; > > typedef enum { >@@ -104,6 +106,8 @@ static const GOptionEntry commandLineOptions[] = > { "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 }, >+ { "cookies-file", 'c', 0, G_OPTION_ARG_FILENAME, &cookiesFile, "Persistent cookie storage database file", "FILE" }, >+ { "cookies-policy", 0, 0, G_OPTION_ARG_STRING, &cookiesPolicy, "Cookies accept policy (always, never, no-third-party). Default: no-third-party", "POLICY" }, > { "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â¦]" }, >@@ -496,6 +500,21 @@ int main(int argc, char *argv[]) > > WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default(); > >+ if (cookiesPolicy) { >+ WebKitCookieManager *cookieManager = webkit_web_context_get_cookie_manager(webContext); >+ GEnumClass *enumClass = g_type_class_ref(WEBKIT_TYPE_COOKIE_ACCEPT_POLICY); >+ GEnumValue *enumValue = g_enum_get_value_by_nick(enumClass, cookiesPolicy); >+ if (enumValue) >+ webkit_cookie_manager_set_accept_policy(cookieManager, enumValue->value); >+ g_type_class_unref(enumClass); >+ } >+ >+ if (cookiesFile && !webkit_web_context_is_ephemeral(webContext)) { >+ WebKitCookieManager *cookieManager = webkit_web_context_get_cookie_manager(webContext); >+ WebKitCookiePersistentStorage storageType = g_str_has_suffix(cookiesFile, ".txt") ? WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT : WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE; >+ webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); >+ } >+ > 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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
pnormand
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185506
: 340074