From 4390eb9eb2c40c9f69916f8e48f06fc099bd0225 Mon Sep 17 00:00:00 2001 From: Bi11 Date: Fri, 14 Dec 2018 02:43:06 +0800 Subject: [PATCH] Fix release note web view's contextual menu Code added in 8ff6c147f26600c9dc15d6f76bed5730dda68af6 does not take effect nowadays due to missing assignment of UIDelegate. --- Sparkle/SUUpdateAlert.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 9ca0ec32..1e880893 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -33,9 +33,11 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE @end @protocol WebPolicyDelegate @end +@protocol WebUIDelegate +@end #endif -@interface SUUpdateAlert () +@interface SUUpdateAlert () @property (strong) SUAppcastItem *updateItem; @property (strong) SUHost *host; @@ -115,8 +117,9 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE - (void)endWithSelection:(SUUpdateAlertChoice)choice { [self.releaseNotesView stopLoading:self]; - [self.releaseNotesView setFrameLoadDelegate:nil]; - [self.releaseNotesView setPolicyDelegate:nil]; + self.releaseNotesView.frameLoadDelegate = nil; + self.releaseNotesView.policyDelegate = nil; + self.releaseNotesView.UIDelegate = nil; [self.releaseNotesView removeFromSuperview]; // Otherwise it gets sent Esc presses (why?!) and gets very confused. [self close]; self.completionBlock(choice); @@ -152,6 +155,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE prefs.javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey]; self.releaseNotesView.frameLoadDelegate = self; self.releaseNotesView.policyDelegate = self; + self.releaseNotesView.UIDelegate = self; // Set the default font // "-apple-system-font" is a reference to the system UI font. "-apple-system" is the new recommended token, but for backward compatibility we can't use it.