diff -up surf/config.def.h surf_toggle_image_flash/config.def.h --- surf/config.def.h 2010-03-22 15:24:22.000000000 +0100 +++ surf_toggle_image_flash/config.def.h 2010-03-22 15:39:10.000000000 +0100 @@ -18,6 +18,8 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK,GDK_r, reload, { .b = TRUE } }, { MODKEY, GDK_r, reload, { .b = FALSE } }, { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 } }, + { MODKEY, GDK_f, toggleflash,{ 0 } }, + { MODKEY, GDK_i, toggleimages,{ 0 } }, { MODKEY, GDK_p, clipboard, { .b = TRUE } }, { MODKEY, GDK_y, clipboard, { .b = FALSE } }, { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } }, Les sous-répertoires surf/.hg et surf_tip_toggle_image_flash/.hg sont identiques. diff -up surf/surf.c surf_toggle_image_flash/surf.c --- surf/surf.c 2010-03-22 15:24:22.000000000 +0100 +++ surf_toggle_image_flash/surf.c 2010-03-22 15:38:38.000000000 +0100 @@ -104,6 +104,8 @@ static void source(Client *c, const Arg static void spawn(Client *c, const Arg *arg); static void stop(Client *c, const Arg *arg); static void titlechange(WebKitWebView *v, WebKitWebFrame* frame, const char* title, Client *c); +static void toggleflash(Client *c, const Arg *arg); +static void toggleimages(Client *c, const Arg *arg); static void update(Client *c); static void updatedownload(WebKitDownload *o, GParamSpec *pspec, Client *c); static void updatewinid(Client *c); @@ -534,6 +536,8 @@ newclient(void) { if(!(ua = getenv("SURF_USERAGENT"))) ua = useragent; g_object_set(G_OBJECT(settings), "user-agent", ua, NULL); + g_object_set(G_OBJECT(settings), "enable-plugins", FALSE, NULL); + g_object_set(G_OBJECT(settings), "auto-load-images", FALSE, NULL); uri = g_strconcat("file://", stylefile, NULL); g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL); g_free(uri); @@ -763,6 +767,26 @@ titlechange(WebKitWebView *v, WebKitWebF } void +toggleflash(Client *c, const Arg *arg) +{ + static int flash = 0; + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + flash = !flash; + g_object_set(G_OBJECT(settings), "enable-plugins", flash, NULL); +} + +void +toggleimages(Client *c, const Arg *arg) +{ + static int images = 0; + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + images = !images; + g_object_set(G_OBJECT(settings), "auto-load-images", images, NULL); +} + +void update(Client *c) { char *t;