[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-15-g6eb5afe08

paul at claws-mail.org paul at claws-mail.org
Wed Dec 23 13:31:32 CET 2020


The branch, gtk3 has been updated
       via  6eb5afe0881e04dc2e77de9cd544d8e550b0cc73 (commit)
      from  80892ff3389e93a1e6676d9081dd81d0c8f571b0 (commit)

Summary of changes:
 src/plugins/fancy/fancy_viewer.c | 8 +++++++-
 src/plugins/fancy/fancy_viewer.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit 6eb5afe0881e04dc2e77de9cd544d8e550b0cc73
Author: Orivej Desh <orivej at gmx.fr>
Date:   Wed Dec 16 23:50:50 2020 +0000

    Disable remote content by using a void proxy
    
    enable-dns-prefetching=0 has stopped blocking remote content after the
    switch to webkit2gtk. Disabling it with a false proxy works.
    
    Setting proxy to "" works well with libsoup-backed webkit2gtk since it
    prevents any connection attempts. If libcurl-backed webkit2gtk won't
    like it, it may be replaced by "http://127.0.0.9:9" (with 9 being
    reserved for the discard service, and 127.0.0.9 being more greppable
    than 127.0.0.1).
    
    Signed-off-by: paul <paul at claws-mail.org>

diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index e504d4ec2..44c0c885e 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -84,7 +84,6 @@ static void fancy_apply_prefs(FancyViewer *viewer)
 		"enable-javascript", viewer->override_prefs_scripts,
 		"enable-plugins", viewer->override_prefs_plugins,
 		"enable-java", viewer->override_prefs_java,
-	    "enable-dns-prefetching", viewer->override_prefs_remote_content,
 /*	    "selected-stylesheet-set", viewer->override_stylesheet,*/
 #ifdef G_OS_WIN32
 		"default-font-family", "Arial",
@@ -96,6 +95,10 @@ static void fancy_apply_prefs(FancyViewer *viewer)
 #endif
 		NULL);
 	webkit_web_view_set_settings(viewer->view, viewer->settings);
+	if (viewer->override_prefs_remote_content)
+		webkit_web_context_set_network_proxy_settings(webkit_web_context_get_default(), WEBKIT_NETWORK_PROXY_MODE_DEFAULT, NULL);
+	else
+		webkit_web_context_set_network_proxy_settings(webkit_web_context_get_default(), WEBKIT_NETWORK_PROXY_MODE_CUSTOM, viewer->no_remote_content_proxy_settings);
 }
 
 static void fancy_auto_load_images_activated(GtkCheckMenuItem *item, FancyViewer *viewer) {
@@ -1033,6 +1036,9 @@ static MimeViewer *fancy_viewer_create(void)
 	}
 */
 	viewer->settings = webkit_settings_new();
+	// Proxy "" makes libsoup backend think that there is no way
+	// to connect, which is ideal.
+	viewer->no_remote_content_proxy_settings = webkit_network_proxy_settings_new("", NULL);
 	g_object_set(viewer->settings, "user-agent", "Fancy Viewer", NULL);
 	viewer->scrollwin = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(viewer->scrollwin),
diff --git a/src/plugins/fancy/fancy_viewer.h b/src/plugins/fancy/fancy_viewer.h
index f72ecfde5..e60c5fad0 100644
--- a/src/plugins/fancy/fancy_viewer.h
+++ b/src/plugins/fancy/fancy_viewer.h
@@ -93,6 +93,7 @@ struct _FancyViewer
 
 	GtkWidget         *progress;
 	WebKitSettings    *settings;
+	WebKitNetworkProxySettings *no_remote_content_proxy_settings;
 	gboolean          printing;
 	gboolean          override_prefs_images;
 	gboolean          override_prefs_remote_content;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list