title: Get macOS default browser name - LSCopyDefaultApplicationURLForContentType
body: <p>I am developing a macOS application in Xcode. One of the things I need to do, is to open URL's the system detault web browser. I have an alert that pops up that gives the user this option. The alert is supposed to show the name of the default web browser. However I am unable to figure out the name of the default web browser.</p>
  
  <p>I have the tried the following code:</p>
  
  <pre><code>NSLog(@"%@", LSCopyDefaultApplicationURLForContentType(kUTTypeURL, kLSRolesAll, nil));
  </code></pre>
  
  <p>It just returns <code>file:///Applications/Opera.app/</code> even though my default browser is set to Safari. Not matter what I change my default browser to (Chrome, Safari, Firefox, etc...), the above method just returns the URL for Opera browser.</p>
  
  <p>Does anyone know how I can find out what the name of the default browser is? I know how to open URL's in the default browser, thats very easy, but getting the name of the default browser isn't.</p>
  
  <p>I know this is possible because apps like Tweetbot, have an option saying "Open in Safari" which changes to whatever you default browser is.</p>
  
  <p>Thanks for your time, Dan.</p>