views:

47

answers:

1

How would you change the default browser programmatically on Mac OSX.

For example from safari to chrome, or chrome to firefox?

Thanks

+1  A: 

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)).

xnyhps
Thanks a bunch!
Jordan