如何让macOS实现我的应用程序是一个Web浏览器?

时间:2017-03-30 23:54:42

标签: macos info.plist

我正在尝试创建一个可以处理http和https网址方案的应用,这样当您打开系统偏好设置>一般情况下,我的应用程序将列在“默认Web浏览器”的下拉列表中。我能找到的所有内容似乎都说我只需要Info.plist包含正确的CFBundleURLTypes值来处理我感兴趣的网址方案。

我相信我做的一切都是正确的,我将自己的Info.plist与其他显示在该列表中的网络浏览器进行了比较,但出于某种原因,我无法自己出现在那里。知道我做错了吗?

这是我的Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict><key>NSHighResolutionCapable</key>
<string>True</string>
<key>CFBundleIdentifier</key>
<string>com.micahflee.porcupine</string>
<key>CFBundleName</key>
<string>Porcupine</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>LSBackgroundOnly</key>
<string>0</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleDisplayName</key>
<string>Porcupine</string>
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Viewer</string>
    <key>CFBundleURLName</key>
    <string>Web site URL</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>http</string>
      <string>https</string>
    </array>
  </dict>
</array>
<key>CFBundleShortVersionString</key>
<string>{{VERSION}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>MacOS/porcupine</string>
</dict>
</plist>

0 个答案:

没有答案