Thursday, July 22, 2010

Add to Google Reader Changes

Add to Google Reader extension icon

One of the things that I really wanted to do with my Add to Google extension for Safari was to offer the option of subscribing via iGoogle. I didn’t expect it to be a popular option and, as far as I know, it’s not. It was, however, educational to implement and I like to think it offered some kind value-add, even if it wasn’t widely used. That said, it’s going away (hopefully to return someday).

Safari’s extension API doesn’t support this functionality in any kind of elegant manner. Under the hood, hijacking the RSS button really means capturing Safari’s native feed display page (it’s just a new page request after all) before it gets shown and redirecting. It’s essentially a meta refresh with a value of zero, except that Safari’s extension API provides a hook into the process immediately before the new page is loaded. If the redirection is executed via that hook, then it can happen in a manner that’s completely transparent to the user.

At this point in the execution process (i.e. the hook executed before the page is loaded), though, settings can’t be accessed cleanly. In order to read the extension settings:

  1. A second file—a “global HTML” file—has to be loaded.
  2. An asynchronous message requesting the extension’s current settings has to be passed to the new file.
  3. A message containing the settings has to be returned to the start script.
  4. The start script has to process the settings and redirect appropriately.

In the strictest functional sense, I had this working, but it had to be hacked. I could live with the inelegance of the hacked solution, but a natural by-product of doing all this work and, moreover, doing it asynchronously was that the Safari feed page was loaded before the settings were returned and redirection could occur. The timing of all this created a user experience that I found completely unacceptable because it made the redirection very obvious and annoying.

Unless and until Safari provides a more robust API that can handle this kind of interception and interaction—specifically synchronous messaging, I’m going to remove the ability to subscribe via iGoogle. My apologies to anyone who was actively using or relying on this feature. I will bring it back if and when I can do so without compromising user experience. If anyone has a problem with this, let me know and I’ll make an earlier release available.

I’ve updated the changelog on the project wiki accordingly.