fix: when the user set a release note url, and that page was creating iframes without src attributes, these would make popups appear saying "There is no application set to open the URL about:blank."

A request URL to about:blank has no purpose of being opened, so we ignore it.
This commit is contained in:
Louis Pontoise committed 2020-05-12 02:12:54 +09:00
1 parent 9568732f78
commit 8f19f6a8cc
1 file changed
+3 -2
+3 -2
View File
@@ -352,7 +352,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
{
NSURL *requestURL = request.URL;
NSString *scheme = requestURL.scheme;
BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"];
BOOL isAboutBlank = [requestURL.absoluteString isEqualToString:@"about:blank"];
BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || isAboutBlank;
// Do not allow redirects to dangerous protocols such as file://
if (!whitelistedSafe) {
@@ -362,7 +363,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
}
if (self.webViewFinishedLoading) {
if (requestURL) {
if (requestURL && !isAboutBlank) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}