From: Christian Dywan Date: Thu, 18 Nov 2010 20:02:37 +0000 (+0100) Subject: Don't show Netscape plugins admist extensions X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ac006804bb0197bfaa26799565aa113ce5a0678;p=midori Don't show Netscape plugins admist extensions People keep thinking plugins could be disabled like extensions. --- diff --git a/midori/main.c b/midori/main.c index b276b5f7..9e5a4ad0 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1044,53 +1044,6 @@ midori_load_cookie_jar (gpointer data) return FALSE; } -static gboolean -midori_load_netscape_plugins (gpointer data) -{ - MidoriApp* app = MIDORI_APP (data); - KatzeArray* extensions = katze_object_get_object (app, "extensions"); - /* FIXME: WebKit should have API to obtain the list of plugins. */ - /* FIXME: Monitor folders for newly added and removes files */ - GtkWidget* web_view = webkit_web_view_new (); - WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view)); - JSContextRef js_context = webkit_web_frame_get_global_context (web_frame); - /* This snippet joins the available plugins into a string like this: - URI1|title1,URI2|title2 - FIXME: Ensure separators contained in the string can't break it */ - gchar* value = sokoke_js_script_eval (js_context, - "function plugins (l) { var f = new Array (); for (i in l) " - "{ var p = l[i].name + '|' + l[i].filename; " - "if (f.indexOf (p) == -1) f.push (p); } return f; }" - "plugins (navigator.plugins)", NULL); - gchar** items = g_strsplit (value, ",", 0); - guint i = 0; - - if (items != NULL) - while (items[i] != NULL) - { - gchar** parts = g_strsplit (items[i], "|", 2); - if (parts && *parts && !g_str_equal (parts[1], "undefined")) - { - MidoriExtension* extension; - gchar* desc = parts[1]; - gsize j = 0; - while (desc[j++]) - if (desc[j-1] == ';') - desc[j-1] = '\n'; - extension = g_object_new (MIDORI_TYPE_EXTENSION, - "name", parts[0], "description", desc, NULL); - g_object_set_data (G_OBJECT (extension), "static", (void*)0xdeadbeef); - katze_array_add_item (extensions, extension); - } - g_strfreev (parts); - i++; - } - g_strfreev (items); - g_object_unref (extensions); - - return FALSE; -} - static gboolean midori_load_extensions (gpointer data) { @@ -1194,9 +1147,6 @@ midori_load_extensions (gpointer data) } g_strfreev (active_extensions); - if (g_getenv ("MIDORI_UNARMED") == NULL) - g_idle_add (midori_load_netscape_plugins, app); - #ifdef G_ENABLE_DEBUG if (startup_timer) g_debug ("Extensions:\t%f", g_test_timer_elapsed ());