How do I know if the user agreed to change their default browser?

In recent versions of OS X—I think this was introduced in Yosemite—changing the default browser by calling

LSSetDefaultHandlerForURLScheme
displays a prompt that gives the user the option of accepting the new default browser, or sticking with their existing one:


Do you want to change your default web browser to “new browser” or keep using “old browser”?


Your default web browser opens when you click links in places like email messages, documents, and other apps.


The call to

LSSetDefaultHandlerForURLScheme
returns immediately, before the user has responded to this prompt, so checking the return value doesn't give any indication of the user's choice.


Is anyone aware of a way of checking what the user chose? There's some UI in my application that should change to indicate if it's currently the default browser, so it's useful to know if the call to

LSSetDefaultHandlerForURLScheme
resulted in a change.


I haven't been able to find any documentation about this prompt. I have no problem with the prompt appearing, but if bypassing it is an option that'd be fine too.

Replies

Wondering this exact same thing, so many years later. Still can't find a way either around the warning message or a way to confirm it's result.

It would be surprising (and worrying) that it were possible for an app to spy which browser I am using. That's not their business.

What one can do is ingenuously ask user. He/she will answer or not, but that will be their decision.