mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
28 lines
643 B
Objective-C
28 lines
643 B
Objective-C
//
|
|
// SUWebViewCommon.m
|
|
// Sparkle
|
|
//
|
|
// Created by Mayur Pawashe on 12/31/20.
|
|
// Copyright © 2020 Sparkle Project. All rights reserved.
|
|
//
|
|
|
|
#if SPARKLE_BUILD_UI_BITS
|
|
|
|
#import "SUWebViewCommon.h"
|
|
|
|
|
|
#include "AppKitPrevention.h"
|
|
|
|
BOOL SUWebViewIsSafeURL(NSURL *url, BOOL *isAboutBlankURL)
|
|
{
|
|
NSString *scheme = url.scheme;
|
|
BOOL isAboutBlank = [url.absoluteString isEqualToString:@"about:blank"];
|
|
BOOL whitelistedSafe = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme];
|
|
|
|
*isAboutBlankURL = isAboutBlank;
|
|
|
|
return whitelistedSafe;
|
|
}
|
|
|
|
#endif
|