From 095704d173040308b7ad5985c94e3b167af62be3 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Fri, 30 Dec 2011 19:26:18 +0100 Subject: FS#201 - option to not load images on webpages Code from Elias Norberg (xyzzy) ok marco@ --- settings.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'settings.c') diff --git a/settings.c b/settings.c index 9ff0137..a8da3d5 100644 --- a/settings.c +++ b/settings.c @@ -91,6 +91,7 @@ int autofocus_onload = 0; int js_autorun_enabled = 1; int edit_mode = XT_EM_HYBRID; int userstyle_global = 0; +int auto_load_images = 1; char *cmd_font_name = NULL; char *oops_font_name = NULL; @@ -119,6 +120,7 @@ int set_tab_style(struct settings *, char *); int set_edit_mode(struct settings *, char *); int set_work_dir(struct settings *, char *); int set_ua_roundrobin(char *); +int set_auto_load_images(char *value); void walk_mime_type(struct settings *, void (*)(struct settings *, char *, void *), void *); @@ -306,7 +308,8 @@ struct settings rs[] = { { "window_maximize", XT_S_INT, 0, &window_maximize, NULL, NULL }, { "work_dir", XT_S_STR, 0, NULL, NULL,&s_work_dir }, { "xterm_workaround", XT_S_INT, 0, &xterm_workaround, NULL, NULL }, - { "user_agent_roundrobin", XT_S_INT, 0, &user_agent_roundrobin, NULL, NULL, NULL, set_ua_roundrobin }, + { "user_agent_roundrobin", XT_S_INT, 0, &user_agent_roundrobin, NULL, NULL, NULL, set_ua_roundrobin }, + { "auto_load_images", XT_S_INT, 0, &auto_load_images, NULL, NULL, NULL, set_auto_load_images }, /* font settings */ { "cmd_font", XT_S_STR, 0, NULL, &cmd_font_name, NULL }, @@ -978,6 +981,20 @@ set_ua_roundrobin(char *value) return (0); } +int +set_auto_load_images(char *value) +{ + struct tab *t; + + auto_load_images = atoi(value); + TAILQ_FOREACH(t, &tabs, entry) { + g_object_set(G_OBJECT(t->settings), + "auto-load-images", auto_load_images, (char *)NULL); + webkit_web_view_set_settings(t->wv, t->settings); + } + return (0); +} + void setup_proxy(char *uri) { -- cgit 1.4.1-2-gfad0 ames'>
path: root/cpp/.traces/convert_names
blob: 94efd2744340412cf5928a3ad8f7de484f09471f (plain) (blame)
1
2
3
4
5
6
7
8
9