diff --git a/Sparkle/SULegacyWebView.m b/Sparkle/SULegacyWebView.m index e714a306..bebf9f6f 100644 --- a/Sparkle/SULegacyWebView.m +++ b/Sparkle/SULegacyWebView.m @@ -11,17 +11,6 @@ #import "SULog.h" #import -// WebKit protocols are not explicitly declared until 10.11 SDK, so -// declare dummy protocols to keep the build working on earlier SDKs. -#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100 -@protocol WebFrameLoadDelegate -@end -@protocol WebPolicyDelegate -@end -@protocol WebUIDelegate -@end -#endif - @interface SULegacyWebView () @property (nonatomic, readonly) WebView *webView; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 37603cb2..3e33219c 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -296,18 +296,12 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE BOOL javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey]; - BOOL useWKWebView; - if (@available(macOS 10.11, *)) { - // WKWebView has a bug where it won't work in loading local HTML content in sandboxed apps that do not have an outgoing network entitlement - // FB6993802: https://twitter.com/sindresorhus/status/1160577243929878528 | https://github.com/feedback-assistant/reports/issues/1 - // If the developer is using the downloader XPC service, they are very most likely are a) sandboxed b) do not use outgoing network entitlement. - // In this case, fall back to legacy WebKit view. - // (In theory it is possible for a non-sandboxed app or sandboxed app with outgoing network entitlement to use the XPC service, it's just pretty unlikely. And falling back to a legacy web view would not be too harmful in those cases). - useWKWebView = !SPUXPCServiceExists(@DOWNLOADER_BUNDLE_ID); - } else { - // Never use WKWebView prior to macOS 10.11. Details are in SUWKWebView.m - useWKWebView = NO; - } + // WKWebView has a bug where it won't work in loading local HTML content in sandboxed apps that do not have an outgoing network entitlement + // FB6993802: https://twitter.com/sindresorhus/status/1160577243929878528 | https://github.com/feedback-assistant/reports/issues/1 + // If the developer is using the downloader XPC service, they are very most likely are a) sandboxed b) do not use outgoing network entitlement. + // In this case, fall back to legacy WebKit view. + // (In theory it is possible for a non-sandboxed app or sandboxed app with outgoing network entitlement to use the XPC service, it's just pretty unlikely. And falling back to a legacy web view would not be too harmful in those cases). + BOOL useWKWebView = !SPUXPCServiceExists(@DOWNLOADER_BUNDLE_ID); if (useWKWebView) { self.webView = [[SUWKWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled]; diff --git a/Sparkle/SUWKWebView.h b/Sparkle/SUWKWebView.h index c7f0738d..2dfb4357 100644 --- a/Sparkle/SUWKWebView.h +++ b/Sparkle/SUWKWebView.h @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN -// Only use this class on macOS 10.11 or later (see implementation for rationale) @interface SUWKWebView : NSObject - (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;