[GTK] Epiphany searching for plugins even if plugins are disabled
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Feb 2019 07:02:05 +0000 (07:02 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Feb 2019 07:02:05 +0000 (07:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194352

Reviewed by Michael Catanzaro.

Check pluginsEnabled setting before trying to get plugins from UI process.

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp

index d91d744..bc5d4b1 100644 (file)
@@ -1,3 +1,15 @@
+2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Epiphany searching for plugins even if plugins are disabled
+        https://bugs.webkit.org/show_bug.cgi?id=194352
+
+        Reviewed by Michael Catanzaro.
+
+        Check pluginsEnabled setting before trying to get plugins from UI process.
+
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        (WebKit::WebPluginInfoProvider::populatePluginCache):
+
 2019-02-21  Darin Adler  <darin@apple.com>
 
         Some refinements for Node and Document
index 5455b30..7684064 100644 (file)
@@ -36,6 +36,7 @@
 #include <WebCore/FrameLoader.h>
 #include <WebCore/Page.h>
 #include <WebCore/SchemeRegistry.h>
+#include <WebCore/Settings.h>
 #include <WebCore/SubframeLoader.h>
 #include <wtf/text/StringHash.h>
 
@@ -146,11 +147,18 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& pa
 void WebPluginInfoProvider::populatePluginCache(const WebCore::Page& page)
 {
     if (!m_pluginCacheIsPopulated) {
-        HangDetectionDisabler hangDetectionDisabler;
-
-        if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPlugins(m_shouldRefreshPlugins),
-            Messages::WebProcessProxy::GetPlugins::Reply(m_cachedPlugins, m_cachedApplicationPlugins, m_cachedSupportedPluginIdentifiers), 0))
-            return;
+#if PLATFORM(COCOA)
+        // Application plugins are not affected by enablePlugins setting, so we always need to scan plugins to get them.
+        bool shouldScanPlugins = true;
+#else
+        bool shouldScanPlugins = page.mainFrame().loader().subframeLoader().allowPlugins();
+#endif
+        if (shouldScanPlugins) {
+            HangDetectionDisabler hangDetectionDisabler;
+            if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPlugins(m_shouldRefreshPlugins),
+                Messages::WebProcessProxy::GetPlugins::Reply(m_cachedPlugins, m_cachedApplicationPlugins, m_cachedSupportedPluginIdentifiers), 0))
+                return;
+        }
 
         m_shouldRefreshPlugins = false;
         m_pluginCacheIsPopulated = true;