Blob Blame Raw
From 5e55ce4e097ed1bb76dd9fc8ae221c3765383e94 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@igalia.com>
Date: Tue, 28 Jun 2016 10:36:40 -0500
Subject: [PATCH] wayland: disable windowless NPAPI plugins

They are seriously broken. We will not enable these in Fedora until the
upstream bug is fixed. The only known plugin this affects is the
gnome-shell browser plugin, which we don't want to support anyway due to
the huge number crash reports.
---
 Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp | 6 ++++++
 Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp  | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 4ba4ac6..4a59d66 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -1621,6 +1621,12 @@ void webkit_settings_set_enable_plugins(WebKitSettings* settings, gboolean enabl
 {
     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
 
+#if PLATFORM(WAYLAND)
+    // https://bugs.webkit.org/show_bug.cgi?id=158697
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland)
+        return;
+#endif
+
     WebKitSettingsPrivate* priv = settings->priv;
     bool currentValue = priv->preferences->pluginsEnabled();
     if (currentValue == enabled)
diff --git a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
index ae14e9e..ed932b1 100644
--- a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
@@ -39,6 +39,8 @@ void WebPreferences::platformInitializeStore()
         // FIXME: Accelerated compositing under Wayland is not yet supported.
         // https://bugs.webkit.org/show_bug.cgi?id=115803
         setAcceleratedCompositingEnabled(false);
+        // https://bugs.webkit.org/show_bug.cgi?id=158697
+        setPluginsEnabled(false);
     }
 #endif
 #if USE(COORDINATED_GRAPHICS_THREADED)
-- 
2.7.4