How would you change the default browser programmatically on Mac OSX.
For example from safari to chrome, or chrome to firefox?
Thanks
How would you change the default browser programmatically on Mac OSX.
For example from safari to chrome, or chrome to firefox?
Thanks
You should use
LSSetDefaultHandlerForURLScheme(CFStringRef inURLScheme, CFStringRef inHandlerBundleID)
. See also http://developer.apple.com/library/mac/#documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html. 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)
).