Title: [276720] trunk
Revision
276720
Author
[email protected]
Date
2021-04-28 10:19:32 -0700 (Wed, 28 Apr 2021)

Log Message

Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449

Patch by Alex Christensen <[email protected]> on 2021-04-28
Reviewed by Geoffrey Garen.

Source/WebKitLegacy/mac:

In r275912 I turned off all plugin support in WebView after looking into use of NP_Initialize, the entry point for NPAPI plugins.
That was too aggressive, as we found some use of the older WebKit plugin entry point, plugInViewWithArguments, and reverted in r276652.
This cuts out only support for NPAPI plugins for now.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createPlugin):

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (276719 => 276720)


--- trunk/Source/WTF/ChangeLog	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Source/WTF/ChangeLog	2021-04-28 17:19:32 UTC (rev 276720)
@@ -1,3 +1,12 @@
+2021-04-28  Alex Christensen  <[email protected]>
+
+        Remove support for NPAPI plugins in WebView
+        https://bugs.webkit.org/show_bug.cgi?id=224449
+
+        Reviewed by Geoffrey Garen.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2021-04-28  Chris Dumez  <[email protected]>
 
         Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (276719 => 276720)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-04-28 17:19:32 UTC (rev 276720)
@@ -536,6 +536,16 @@
     WebKit:
       default: false
 
+NPAPIPlugInsEnabledForTestingInWebKitLegacy:
+  type: bool
+  humanReadableName: "NPAPI Plug-Ins Enabled In WebKitLegacy"
+  humanReadableDescription: "Enable NPAPI Plug-Ins for testing"
+  webcoreBinding: none
+  exposed: [ WebKitLegacy ]
+  defaultValue:
+    WebKitLegacy:
+      default: false
+
 OffscreenCanvasEnabled:
   type: bool
   humanReadableName: "OffscreenCanvas"

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (276719 => 276720)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-28 17:19:32 UTC (rev 276720)
@@ -1,3 +1,17 @@
+2021-04-28  Alex Christensen  <[email protected]>
+
+        Remove support for NPAPI plugins in WebView
+        https://bugs.webkit.org/show_bug.cgi?id=224449
+
+        Reviewed by Geoffrey Garen.
+
+        In r275912 I turned off all plugin support in WebView after looking into use of NP_Initialize, the entry point for NPAPI plugins.
+        That was too aggressive, as we found some use of the older WebKit plugin entry point, plugInViewWithArguments, and reverted in r276652.
+        This cuts out only support for NPAPI plugins for now.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createPlugin):
+
 2021-04-28  Chris Dumez  <[email protected]>
 
         Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (276719 => 276720)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2021-04-28 17:19:32 UTC (rev 276720)
@@ -67,6 +67,7 @@
 #import "WebPolicyDelegate.h"
 #import "WebPolicyDelegatePrivate.h"
 #import "WebPreferences.h"
+#import "WebPreferencesInternal.h"
 #import "WebResourceLoadDelegate.h"
 #import "WebResourceLoadDelegatePrivate.h"
 #import "WebScriptWorldInternal.h"
@@ -1934,7 +1935,7 @@
             errorCode = WebKitErrorBlockedPlugInVersion;
             if (is<WebCore::RenderEmbeddedObject>(element.renderer()))
                 downcast<WebCore::RenderEmbeddedObject>(*element.renderer()).setPluginUnavailabilityReason(WebCore::RenderEmbeddedObject::InsecurePluginVersion);
-        } else {
+        } else if ([webView.preferences _boolValueForKey:@"WebKitNPAPIPlugInsEnabledForTestingInWebKitLegacy"]) {
             if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
                 view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, attributeKeys.get(), createNSArray(paramValues).get(), baseURL, kit(&element), loadManually);
 #if ENABLE(NETSCAPE_PLUGIN_API)

Modified: trunk/Tools/ChangeLog (276719 => 276720)


--- trunk/Tools/ChangeLog	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Tools/ChangeLog	2021-04-28 17:19:32 UTC (rev 276720)
@@ -1,3 +1,13 @@
+2021-04-28  Alex Christensen  <[email protected]>
+
+        Remove support for NPAPI plugins in WebView
+        https://bugs.webkit.org/show_bug.cgi?id=224449
+
+        Reviewed by Geoffrey Garen.
+
+        * DumpRenderTree/TestOptions.cpp:
+        (WTR::TestOptions::defaults):
+
 2021-04-28  Kimmo Kinnunen  <[email protected]>
 
         Asserting that function or variable is accessed in a certain thread should be simpler and more robust

Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (276719 => 276720)


--- trunk/Tools/DumpRenderTree/TestOptions.cpp	2021-04-28 17:13:40 UTC (rev 276719)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp	2021-04-28 17:19:32 UTC (rev 276720)
@@ -89,6 +89,7 @@
             { "MediaDevicesEnabled", true },
             { "MediaPreloadingEnabled", true },
             { "MockScrollbarsEnabled", true },
+            { "NPAPIPlugInsEnabledForTestingInWebKitLegacy", true },
             { "NeedsStorageAccessFromFileURLsQuirk", false },
             { "OfflineWebApplicationCacheEnabled", true },
             { "RequiresUserGestureForAudioPlayback", false },
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to