diff --git a/midori/midori-view.c b/midori/midori-view.c index 4e0167da..5669d788 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -3682,6 +3682,43 @@ midori_view_construct_web_view (MidoriView* view) NULL); } +static gchar* list_netscape_plugins () +{ + 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 */ + 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; + GString* ns_plugins = g_string_new (NULL); + if (items != NULL) + while (items[i] != NULL) + { + gchar** parts = g_strsplit (items[i], "|", 2); + if (parts && *parts && !g_str_equal (parts[1], "undefined")) + { + g_string_append (ns_plugins, "