Reputation: 21760
How would you change the default browser programmatically on Mac OSX.
For example from safari to chrome, or chrome to firefox?
Thanks
Upvotes: 2
Views: 2535
Reputation: 3316
You should use
LSSetDefaultHandlerForURLScheme(
CFStringRef inURLScheme, CFStringRef inHandlerBundleID)
See also Launch Service Reference Docs.
Use @"http"
for the inURLScheme
, and figure out the bundle identifiers of Firefox, Chrome etc. to use.
You can also check which are installed using
LSCopyAllHandlersForURLScheme(CFStringRef inURLScheme)
Upvotes: 4