Development:Supporting Additional Web-based Feed Readers

From Camino Wiki
Jump to: navigation, search

Camino 1.6 and newer ship with small AppleScript applications that handle the feed:// protocol in order to support choosing certain web-based feed readers (Google’s iGoogle and Google Reader, My Yahoo!, and Bloglines) as the user’s default feed reader.

The code for these applications lives in camino/feedhandlers, with supporting code in MainController.mm (prelaunchHelperApps, helperAppPrelaunchComplete, and doBackgroundPrelaunch:) to handle Quarantine and LaunchServices registration on the first launch of a Camino version.

Although the feedhandlers code is designed to built by Makefile (using osacompile and various shell commands), it is possible to manually assemble your own feedhandler application based on the source.

Contents

Preparation

  1. Grab a copy of Camino’s feedhander source, either by checking out the Camino code, downloading a Camino source tarball, or viewing the source files in MXR, clicking the “Raw file” link in the box on the upper right, and saving the files.
  2. Next, you need to discover the service's subscription URL. This may be specified by the navigator.registerProtocolHandler JavaScript call on the site, if the site offers itself as a web-based protocol handler. For example, the Google feed subscription URL is http://www.google.com/ig/add?feedurl= (in a navigator.registerProtocolHandler JavaScript call, this is the content up to the %s of the call’s second argument).

Building the AppleScript applet

  1. Rename feedhandlers.applescript.in to feedhandlers.applescript and open the file in Script Editor or AppleScript Editor.
  2. Replace %FEED_HANDLER_URL% with the URL from step 2 of the Preparation section, e.g. http://www.google.com/ig/add?feedurl= in the Google case.
  3. Save the script as an “Application bundle”, giving it the name of your web-based feed reader (e.g., “Super Feedreader”). Be sure that "Stay Open" and "Startup Screen" are not checked.

Editing the Info.plist

  1. Now you must perform surgery on the bundle of the application you just saved. In the Finder, control-click on your application and choose “Show Package Contents” from the context menu.
  2. Open your application’s Info.plist file (e.g., Super Feedreader.app/Contents/Info.plist) in a text editor, select the entire contents, and delete them.
  3. Open the Info.plist.in from Camino’s feedhandlers source in a text editor, copy the entire contents, and paste them into your application’s Info.plist file.
  4. Replace %FEED_HANDLER_CFBUNDLE_NAME% and %FEED_HANDLER_DISPLAY_NAME% with your application’s name, e.g. “Super Feedreader”.
  5. Fix the copyright string (the information inside the <string> tags just below the <key>CFBundleGetInfoString</key> line).
  6. Change the bundle identifier (the information inside the <string> tags just below the <key>CFBundleIdentifier</key> line) to a value appropriate for your application, e.g. com.mydomain.superfeedreader.
  7. Replace %FEED_HANDLER_CREATOR% with a four-letter creator code (must be all uppercase or mixed case and should not collide with the creator code of any other application).
  8. Save the Info.plist file.

Editing PkgInfo

  1. Open your application’s PkgInfo file (e.g., Super Feedreader.app/Contents/PkgInfo) in a text editor and replace the last four letters with the creator code you chose in step 7 above. Save the PkgInfo file.

Providing a custom application icon

  1. If you want the application to have a custom icon, prepare the icon as a .icns file and then copy it into your application bundle’s Resources folder as applet.icns, replacing the existing Super Feedreader.app/Contents/Resources/applet.icns file.

Registering the completed application with Mac OS X

  1. Finally, move your application from the Application folder to the Desktop, and then move it back to the Applications folder. Double-click your application once to launch it (it should launch and quit, invisibly). These steps are necessary to have Mac OS X LaunchServices recognize your application and read the changes you made to the Info.plist file.

At this point, you should be able to select your application as a feed reader. (Camino caches the list of available feed readers for a period of time, so if you add a new reader after you've already opened the General preference pane, you may have to quit Camino and restart before you can use Camino’s UI to select the default feed reader.)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox