0

is it posible to change Mac safari setting by app after getting user permission if yes then how its done by objective c code. if no why.

Ron Gahlot
  • 1,396
  • 8
  • 18

1 Answers1

0

An application can only change settings of another application if sandbox is disabled, by editing the application settings dictionary file:

NSString *safariSettingsPath = [@"~/Library/Preferences/com.apple.Safari.plist" stringByExpandingTildeInPath];
NSMutableDictionary *safariSettings = [[NSMutableDictionary alloc] initWithContentsOfFile:safariSettingsPath];
safariSettings[@"ExtensionsEnabled"] = @(NO);
[safariSettings writeToFile:safariSettingsPath atomically:YES];
Maarten Foukhar
  • 349
  • 1
  • 11