diff -u surf-0.1.2/config.def.h surf-0.1.2-flash/config.def.h --- surf-0.1.2/config.def.h 2009-09-11 02:40:39.000000000 -0500 +++ surf-0.1.2-flash/config.def.h 2009-09-17 19:36:17.000000000 -0500 @@ -1,4 +1,5 @@ /* modifier 0 means no modifier */ +static gboolean disableFlash = 1; /* 0 keeps plugins enabled */ static gchar *progress = "#FF0000"; static gchar *progress_trust = "#00FF00"; #define MODKEY GDK_CONTROL_MASK @@ -11,6 +12,10 @@ { 0, GDK_Escape, hidesearch, { 0 }, ALWAYS }, { 0, GDK_Escape, hideurl, { 0 }, ALWAYS }, { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 }, ALWAYS }, + { MODKEY, GDK_f, flashoff, { 0 }, ALWAYS }, + { MODKEY, GDK_f, reload, { .b = FALSE }, ALWAYS }, + { MODKEY|GDK_SHIFT_MASK,GDK_f, flashon, { 0 }, ALWAYS }, + { MODKEY|GDK_SHIFT_MASK,GDK_f, reload, { .b = FALSE }, ALWAYS }, { MODKEY, GDK_p, clipboard, { .b = TRUE }, BROWSER }, { MODKEY, GDK_y, clipboard, { .b = FALSE }, BROWSER }, { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 }, BROWSER }, diff -u surf-0.1.2/surf.c surf-0.1.2-flash/surf.c --- surf-0.1.2/surf.c 2009-09-11 02:40:39.000000000 -0500 +++ surf-0.1.2-flash/surf.c 2009-09-17 19:34:53.000000000 -0500 @@ -81,6 +81,8 @@ static void drawindicator(Client *c); static gboolean exposeindicator(GtkWidget *w, GdkEventExpose *e, Client *c); static gboolean initdownload(WebKitWebView *view, WebKitDownload *o, Client *c); +static void flashoff(Client *c, const Arg *arg); +static void flashon(Client *c, const Arg *arg); static gchar *geturi(Client *c); static void hidesearch(Client *c, const Arg *arg); static void hideurl(Client *c, const Arg *arg); @@ -245,6 +247,20 @@ return TRUE; } +void +flashoff(Client *c, const Arg *arg) { + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + g_object_set (G_OBJECT(settings), "enable-plugins", FALSE, NULL); +} + +void +flashon(Client *c, const Arg *arg) { + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + g_object_set (G_OBJECT(settings), "enable-plugins", TRUE, NULL); +} + gchar * geturi(Client *c) { gchar *uri; @@ -452,6 +468,7 @@ gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); webkit_web_view_set_full_content_zoom(c->view, TRUE); settings = webkit_web_view_get_settings(c->view); + g_object_set (G_OBJECT(settings), "enable-plugins", !disableFlash, NULL); g_object_set (G_OBJECT(settings), "user-agent", "surf", NULL); filename = g_build_filename(workdir, "style.css", NULL); filename = g_strdup_printf("file://%s", filename);