How to map a custom protocol to an application on the Mac?

前端 未结 6 900
情书的邮戳
情书的邮戳 2020-11-27 02:58

I\'m trying to register a custom protocol to an application on the Mac, i.e:

  1. User clicks on link with \"abcdef://some/url/here\"
  2. An installed applicat
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 03:09

    I've not had occasion to use it, but some time ago I bookmarked OS X URL handler to open links to local files which is exactly what you're looking for.

    The important part of the linked procedure is adding an appropriate CFBundleURLTypes to your application's Info.plist that describes the scheme. The example given there looks like this:

    CFBundleURLTypes
    
        
            CFBundleURLName
            Local File
            CFBundleURLSchemes
            
                local
            
        
    
    

提交回复
热议问题