2009-02-27 35 views
8

Lo he hecho en Windows, ¿cómo registro un protocolo en mac osx? Quiero hacer clic en los enlaces en firefox (a href = "somename: // mylinkAndData") y ejecutar un archivo binario?registrar un protocolo en mac osx?

Respuesta

13

Eche un vistazo a Launch Services Programming Guide de Apple. Debe agregar CFBundleURLTypes a su Info.plist de aplicaciones y registrar su aplicación con LSRegisterURL().

Extracto de Firefox.app/Contents/Info.plist:

<key>CFBundleURLTypes</key> 
    <array> 
      <dict> 
        <key>CFBundleURLIconFile</key> 
        <string>document.icns</string> 
        <key>CFBundleURLName</key> 
        <string>http URL</string> 
        <key>CFBundleURLSchemes</key> 
        <array> 
          <string>http</string> 
        </array> 
      </dict> 
.... 

EDIT: Ver Handling URL schemes in Cocoa para un artículo cómo-a