diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2020-06-18 16:44:28 +0200 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2020-07-09 08:48:42 +0200 |
commit | 61e39d94d60851bfb7d43d42b31759373dd7ba73 (patch) | |
tree | b1808fa29bc88ed717643a9b94f84a911b7b5e5e /embed/ephy-embed-shell.c | |
parent | e83fb83f2eccb03a6ef37a1f98d3fe21bbd8156e (diff) | |
download | epiphany-61e39d94d60851bfb7d43d42b31759373dd7ba73.tar.gz |
Add support for Intelligent Tracking Prevention (ITP)
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r-- | embed/ephy-embed-shell.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index bdcfae349..eea168a83 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -783,6 +783,10 @@ ephy_embed_shell_create_web_context (EphyEmbedShell *shell) NULL); } + webkit_website_data_manager_set_itp_enabled (manager, + g_settings_get_boolean (EPHY_SETTINGS_WEB, + EPHY_PREFS_WEB_ENABLE_ITP)); + priv->web_context = g_object_new (WEBKIT_TYPE_WEB_CONTEXT, "website-data-manager", manager, "process-swap-on-cross-site-navigation-enabled", TRUE, @@ -845,6 +849,20 @@ remember_passwords_setting_changed_cb (GSettings *settings, } static void +enable_itp_setting_changed_cb (GSettings *settings, + char *key, + EphyEmbedShell *shell) +{ + EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell); + WebKitWebsiteDataManager *manager; + + manager = webkit_web_context_get_website_data_manager (priv->web_context); + webkit_website_data_manager_set_itp_enabled (manager, + g_settings_get_boolean (EPHY_SETTINGS_WEB, + EPHY_PREFS_WEB_ENABLE_ITP)); +} + +static void ephy_embed_shell_startup (GApplication *application) { EphyEmbedShell *shell = EPHY_EMBED_SHELL (application); @@ -941,6 +959,9 @@ ephy_embed_shell_startup (GApplication *application) g_signal_connect_object (EPHY_SETTINGS_WEB, "changed::remember-passwords", G_CALLBACK (remember_passwords_setting_changed_cb), shell, 0); + + g_signal_connect_object (EPHY_SETTINGS_WEB, "changed::enable-itp", + G_CALLBACK (enable_itp_setting_changed_cb), shell, 0); } static void |