Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[client] avoid doing anything in app extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Jun 19, 2017
1 parent e49284e commit e228e88
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions client/Client.x
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,17 @@
#pragma mark - Constructor

%ctor {
NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;

if ([bundleIdentifier isEqualToString:@"com.apple.accessibility.AccessibilityUIServer"] || [bundleIdentifier isEqualToString:@"com.apple.SafariViewService"]) {
NSBundle *bundle = [NSBundle mainBundle];
NSString *bundleIdentifier = bundle.bundleIdentifier;
NSDictionary <NSString *, id> *infoPlist = bundle.infoDictionary;

// blacklist:
// • AccessibilityUIServer (has no status bar anyway)
// • SafariViewService (no idea why it crashes…)
// • app extensions/plugins (can have a pretty locked down sandbox)
if ([bundleIdentifier isEqualToString:@"com.apple.accessibility.AccessibilityUIServer"]
|| [bundleIdentifier isEqualToString:@"com.apple.SafariViewService"]
|| infoPlist[@"NSExtension"] || infoPlist[@"PlugInKit"]) {
return;
}

Expand Down

0 comments on commit e228e88

Please sign in to comment.