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.
Asked
Active
Viewed 644 times
0
-
Read this: https://stackoverflow.com/questions/9632294/is-it-possible-to-change-ios-safari-settings-programmatically – Faysal Ahmed Feb 26 '18 at 11:35
-
where safari preference file located which have setting information like search engine – Ron Gahlot Feb 26 '18 at 11:49
-
Which setting do you want to change? – Willeke Feb 26 '18 at 12:37
-
search engine change programmatically by app or extension after getting user permission – Ron Gahlot Feb 26 '18 at 12:39
1 Answers
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