Add var: disable_plugins
authorDuClare <akarinotengoku@gmail.com>
Fri, 22 May 2009 10:31:58 +0000 (13:31 +0300)
committerDuClare <akarinotengoku@gmail.com>
Fri, 22 May 2009 10:31:58 +0000 (13:31 +0300)
uzbl.c
uzbl.h

diff --git a/uzbl.c b/uzbl.c
index 30cd465..17609f6 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -112,6 +112,7 @@ const struct {
     { "default_font_size",  {.ptr = (void *)&uzbl.behave.default_font_size,    .type = TYPE_INT,    .func = cmd_default_font_size}},
     { "default_monospace_size",  {.ptr = (void *)&uzbl.behave.default_monospace_size,    .type = TYPE_INT,    .func = cmd_default_font_size}},
     { "minimum_font_size",  {.ptr = (void *)&uzbl.behave.minimum_font_size,    .type = TYPE_INT,    .func = cmd_minimum_font_size}},
+    { "disable_plugins",    {.ptr = (void *)&uzbl.behave.disable_plugins,      .type = TYPE_INT,    .func = cmd_disable_plugins}},
     { "shell_cmd",          {.ptr = (void *)&uzbl.behave.shell_cmd,            .type = TYPE_STRING, .func = NULL}},
     { "proxy_url",          {.ptr = (void *)&uzbl.net.proxy_url,               .type = TYPE_STRING, .func = set_proxy_url}},
     { "max_conns",          {.ptr = (void *)&uzbl.net.max_conns,               .type = TYPE_INT,    .func = cmd_max_conns}},
@@ -1126,6 +1127,12 @@ cmd_default_font_size() {
 }
 
 static void
+cmd_disable_plugins() {
+    WebKitWebSettings *ws = webkit_web_view_get_settings(uzbl.gui.web_view);
+    g_object_set (G_OBJECT(ws), "enable-plugins", !uzbl.behave.disable_plugins, NULL);
+}
+
+static void
 cmd_minimum_font_size() {
     WebKitWebSettings *ws = webkit_web_view_get_settings(uzbl.gui.web_view);
     g_object_set (G_OBJECT(ws), "minimum-font-size", uzbl.behave.minimum_font_size, NULL);
diff --git a/uzbl.h b/uzbl.h
index ecb992c..fa31d84 100644 (file)
--- a/uzbl.h
+++ b/uzbl.h
@@ -150,6 +150,7 @@ typedef struct {
     guint    default_font_size;
     guint    default_monospace_size;
     guint    minimum_font_size;
+    guint    disable_plugins;
     gchar*   shell_cmd;
 
     /* command list: name -> Command  */
@@ -408,6 +409,9 @@ static void
 cmd_default_font_size();
 
 static void
+cmd_disable_plugins();
+
+static void
 cmd_minimum_font_size();
 
 static void