Title: [275910] trunk
Revision
275910
Author
commit-qu...@webkit.org
Date
2021-04-13 14:18:25 -0700 (Tue, 13 Apr 2021)

Log Message

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

Patch by Alex Christensen <achristen...@webkit.org> on 2021-04-13
Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):
(-[WKPreferences plugInsEnabled]):
(-[WKPreferences setPlugInsEnabled:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Copying.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[PlugInDelegate _webView:unavailablePlugInButtonClickedWithReason:plugInInfo:]): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (275909 => 275910)


--- trunk/Source/WebKit/ChangeLog	2021-04-13 20:55:15 UTC (rev 275909)
+++ trunk/Source/WebKit/ChangeLog	2021-04-13 21:18:25 UTC (rev 275910)
@@ -1,3 +1,16 @@
+2021-04-13  Alex Christensen  <achristen...@webkit.org>
+
+        Remove support for NPAPI plugins in WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=224451
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences encodeWithCoder:]):
+        (-[WKPreferences initWithCoder:]):
+        (-[WKPreferences plugInsEnabled]):
+        (-[WKPreferences setPlugInsEnabled:]):
+
 2021-04-13  Said Abou-Hallawa  <s...@apple.com>
 
         [GPU Process] Make ImageBuffer calculate its memoryCost() from its size

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (275909 => 275910)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-04-13 20:55:15 UTC (rev 275909)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-04-13 21:18:25 UTC (rev 275910)
@@ -78,7 +78,6 @@
 #if PLATFORM(MAC)
 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     [coder encodeBool:self.javaEnabled forKey:@"javaEnabled"];
-    [coder encodeBool:self.plugInsEnabled forKey:@"plugInsEnabled"];
 ALLOW_DEPRECATED_DECLARATIONS_END
     [coder encodeBool:self.tabFocusesLinks forKey:@"tabFocusesLinks"];
 #endif
@@ -100,7 +99,6 @@
 #if PLATFORM(MAC)
 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     self.javaEnabled = [coder decodeBoolForKey:@"javaEnabled"];
-    self.plugInsEnabled = [coder decodeBoolForKey:@"plugInsEnabled"];
 ALLOW_DEPRECATED_DECLARATIONS_END
     self.tabFocusesLinks = [coder decodeBoolForKey:@"tabFocusesLinks"];
 #endif
@@ -1512,12 +1510,13 @@
 
 - (BOOL)plugInsEnabled
 {
-    return _preferences->pluginsEnabled();
+    return NO;
 }
 
 - (void)setPlugInsEnabled:(BOOL)plugInsEnabled
 {
-    _preferences->setPluginsEnabled(plugInsEnabled);
+    if (plugInsEnabled)
+        RELEASE_LOG_FAULT(Plugins, "Application attempted to enable NPAPI plug ins, which are no longer supported");
 }
 
 #endif

Modified: trunk/Tools/ChangeLog (275909 => 275910)


--- trunk/Tools/ChangeLog	2021-04-13 20:55:15 UTC (rev 275909)
+++ trunk/Tools/ChangeLog	2021-04-13 21:18:25 UTC (rev 275910)
@@ -1,3 +1,15 @@
+2021-04-13  Alex Christensen  <achristen...@webkit.org>
+
+        Remove support for NPAPI plugins in WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=224451
+
+        Reviewed by Chris Dumez.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/Copying.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
+        (-[PlugInDelegate _webView:unavailablePlugInButtonClickedWithReason:plugInInfo:]): Deleted.
+
 2021-04-13  Yusuke Suzuki  <ysuz...@apple.com>
 
         [WTF] Add Vector&& move constructor / assignment to FixedVector and RefCountedArray

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Copying.mm (275909 => 275910)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Copying.mm	2021-04-13 20:55:15 UTC (rev 275909)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Copying.mm	2021-04-13 21:18:25 UTC (rev 275910)
@@ -49,7 +49,7 @@
     EXPECT_EQ([a _javascript_CanOpenWindowsAutomatically], [b _javascript_CanOpenWindowsAutomatically]);
 #if PLATFORM(MAC)
     EXPECT_EQ([a javaEnabled], [b javaEnabled]);
-    EXPECT_EQ([a plugInsEnabled], [b plugInsEnabled]);
+    EXPECT_EQ([a plugInsEnabled], NO);
     EXPECT_EQ([a tabFocusesLinks], [b tabFocusesLinks]);
 #endif
 
@@ -71,7 +71,7 @@
     EXPECT_NE([a _javascript_CanOpenWindowsAutomatically], [b _javascript_CanOpenWindowsAutomatically]);
 #if PLATFORM(MAC)
     EXPECT_NE([a javaEnabled], [b javaEnabled]);
-    EXPECT_NE([a plugInsEnabled], [b plugInsEnabled]);
+    EXPECT_EQ([a plugInsEnabled], [b plugInsEnabled]);
     EXPECT_NE([a tabFocusesLinks], [b tabFocusesLinks]);
 #endif
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (275909 => 275910)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm	2021-04-13 20:55:15 UTC (rev 275909)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm	2021-04-13 21:18:25 UTC (rev 275910)
@@ -718,32 +718,6 @@
     TestWebKitAPI::Util::run(&done);
 }
 
-@interface PlugInDelegate : NSObject <WKUIDelegatePrivate>
-@end
-
-@implementation PlugInDelegate
-
-- (void)_webView:(WKWebView *)webView unavailablePlugInButtonClickedWithReason:(_WKPlugInUnavailabilityReason)reason plugInInfo:(NSDictionary *)plugInInfo
-{
-    ASSERT_EQ(_WKPlugInUnavailabilityReasonPluginMissing, reason);
-    ASSERT_TRUE([@"application/x-shockwave-flash" isEqualToString:[plugInInfo objectForKey:@"PluginInformationMIMEType"]]);
-    done = true;
-}
-
-@end
-
-TEST(WebKit, UnavailablePlugIn)
-{
-    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    [[configuration preferences] setPlugInsEnabled:YES];
-    auto delegate = adoptNS([[PlugInDelegate alloc] init]);
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration.get()]);
-    [webView setUIDelegate:delegate.get()];
-    [webView synchronouslyLoadHTMLString:@"<object type='application/x-shockwave-flash'/>"];
-    [webView sendClicksAtPoint:NSMakePoint(210, 600 - 80) numberOfClicks:1];
-    TestWebKitAPI::Util::run(&done);
-}
-
 bool firstToolbarDone;
 
 @interface ToolbarDelegate : NSObject <WKUIDelegatePrivate>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to