Remove more legacy pre 10.11 checks

This commit is contained in:
Zorg committed 2021-05-29 22:53:25 -07:00
1 parent 549a8ce117
commit 87a4e349ce
3 files changed
+6 -24

No files matched your search

-11
View File
@@ -11,17 +11,6 @@
#import "SULog.h"
#import <WebKit/WebKit.h>
// 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 <NSObject>
@end
@protocol WebPolicyDelegate <NSObject>
@end
@protocol WebUIDelegate <NSObject>
@end
#endif
@interface SULegacyWebView () <WebPolicyDelegate, WebFrameLoadDelegate, WebUIDelegate>
@property (nonatomic, readonly) WebView *webView;
+6 -12
View File
@@ -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];
-1
View File
@@ -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 <SUWebView>
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;