2010-12-27 Carlos Garcia Campos <cgarcia@igalia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Dec 2010 17:37:25 +0000 (17:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Dec 2010 17:37:25 +0000 (17:37 +0000)
        Reviewed by Martin Robinson.

        [GTK] Disable flash plugin in GtkLauncher when using gtk3
        https://bugs.webkit.org/show_bug.cgi?id=51591

        Flash plugin uses gtk2 that is incompatible with gtk3 making
        webkit crash when it's built with gtk3.

        * GtkLauncher/main.c:
        (main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74685 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/GtkLauncher/main.c

index 18b27c8..cbf5af9 100644 (file)
@@ -1,3 +1,16 @@
+2010-12-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Disable flash plugin in GtkLauncher when using gtk3
+        https://bugs.webkit.org/show_bug.cgi?id=51591
+
+        Flash plugin uses gtk2 that is incompatible with gtk3 making
+        webkit crash when it's built with gtk3.
+
+        * GtkLauncher/main.c:
+        (main):
+
 2010-12-25  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index a1baf05..ad666e2 100644 (file)
@@ -230,6 +230,24 @@ static gchar* filenameToURL(const char* filename)
     return fileURL;
 }
 
+#ifndef GTK_API_VERSION_2
+static void disablePlugin(const char* pluginName)
+{
+    WebKitWebPluginDatabase *database = webkit_get_web_plugin_database();
+    GSList *plugins = webkit_web_plugin_database_get_plugins(database);
+    GSList *p;
+
+    for (p = plugins; p; p = g_slist_next(p)) {
+        WebKitWebPlugin *plugin = WEBKIT_WEB_PLUGIN(p->data);
+
+        if (!g_strcmp0(webkit_web_plugin_get_name(plugin), pluginName))
+            webkit_web_plugin_set_enabled(plugin, FALSE);
+    }
+
+    webkit_web_plugin_database_plugins_list_free(plugins);
+}
+#endif
+
 int main(int argc, char* argv[])
 {
     WebKitWebView *webView;
@@ -239,6 +257,10 @@ int main(int argc, char* argv[])
     if (!g_thread_supported())
         g_thread_init(NULL);
 
+#ifndef GTK_API_VERSION_2
+    disablePlugin("Shockwave Flash");
+#endif
+
     main_window = createWindow(&webView);
 
     gchar *uri =(gchar*)(argc > 1 ? argv[1] : "http://www.google.com/");