Enumerating installed browsers on OS X

Use LSCopyAllHandlersForURLScheme(CFSTR("http")) or LSCopyAllRoleHandlersForContentType(CFSTR("public.html"), kLSRolesViewer), or the set intersection of both.

Those two functions return bundle identifiers; you can use LSFindApplicationForInfo to find the preferred instance on disk of an application by its bundle identifier.

(Don't forget to follow the Core Foundation memory-management rules.)

Edit: In a comment on this answer, smorgan suggests LSCopyAllHandlersForURLScheme(CFSTR("https")) (that's https) as an alternative to the first call. This is a good suggestion.

Tags:

Macos

Cocoa