mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Implement loadRequest method on SUWebView
This commit is contained in:
1 parent
dfff98d19e
commit
6283992215
4 files changed
+26
-1
No files matched your search
Vendored
+6
@@ -78,6 +78,12 @@
|
||||
[[self.webView mainFrame] loadData:data MIMEType:MIMEType textEncodingName:textEncodingName baseURL:baseURL];
|
||||
}
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
[[self.webView mainFrame] loadRequest:urlRequest];
|
||||
}
|
||||
|
||||
- (void)stopLoading
|
||||
{
|
||||
self.completionHandler = nil;
|
||||
|
||||
Vendored
+7
-1
@@ -159,7 +159,13 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
// If there's a release notes URL, load it; otherwise, just stick the contents of the description into the web view.
|
||||
if ([self.updateItem releaseNotesURL])
|
||||
{
|
||||
//[[self.releaseNotesView mainFrame] loadRequest:[NSURLRequest requestWithURL:[self.updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]];
|
||||
__weak __typeof__(self) weakSelf = self;
|
||||
[self.webView loadRequest:[NSURLRequest requestWithURL:[self.updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30] completionHandler:^(NSError * _Nullable error) {
|
||||
if (error != nil) {
|
||||
SULog(SULogLevelError, @"Failed to load URL request from web view: %@", error);
|
||||
}
|
||||
[weakSelf stopReleaseNotesSpinner];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Vendored
+11
@@ -135,6 +135,17 @@ static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
self.currentNavigation = [self.webView loadRequest:urlRequest];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)setDrawsBackground:(BOOL)drawsBackground
|
||||
{
|
||||
if (self.drawsWebViewBackground != drawsBackground) {
|
||||
|
||||
Vendored
+2
@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler;
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler;
|
||||
|
||||
- (void)stopLoading;
|
||||
|
||||
- (void)setDrawsBackground:(BOOL)drawsBackground;
|
||||
|
||||
Reference in new issue
Block a user