Month: <span>August 2012</span>

This is part 1 in a series of posts about creating a web-based replacement for the Firefox Home iOS app.

I installed the Firefox Home iOS app shortly after I got an iPhone 4S in late 2011. It provided access to my 1,500+ bookmarks from my phone, and it has a nice feature where it can be set to use Safari as the browser rather than a UIWebView. However, that version, and still the current one as of this writing, has some sort of bug which is horribly annoying.

Occasionally I would add a new bookmark from my desktop, Firefox Home would refresh its data, and then its ordering of bookmarks would get messed up. It was most prevalent in the Bookmark Toolbar directory, in which I have subdirectories and individual bookmarks. I have all of the subdirectories positioned at the far left end of the toolbar in Firefox itself, and they are shown at the top of the main UI in Firefox Home. But when this problem occurred, they would get shuffled around in the UI with no apparent rhyme or reason. It would even happen if I didn’t explicitly add something to the toolbar directory. I haven’t been able to figure out the exact circumstances that cause it, but it has happened enough that I decided to create a replacement, as a personal project.

Unfortunately I don’t own a Mac or know Objective-C, so I decided to create a mobile web app using ASP.NET, C# and jQuery Mobile, and to document the process. My first goal was to successfully get data out of my own Sync account. Sadly, the Sync API is not as well documented as it could be. What documentation does exists is fairly spread out, and there aren’t any canonical examples of how to write clients for it. Plus it has a complex security design; a specific series of decryption steps are needed to read data from a Sync account.

Through some Google searching I stumbled upon a sample program a guy had written in Python that did all the proper encryption stuff and was able to retrieve bookmarks. I managed to duplicate the process in C# after some trial and error, to the point where I could see decrypted data from my own account. It was then that I decided, on a lark really, to search the web to see if anybody had written any .NET wrappers for the Sync API. And wouldn’t you know, Pieter De Rycke had done just that. In fact, he had written a complete Windows Phone version of Firefox Home. So I decided that reinventing the wheel wasn’t necessary, and I used the bits of his project that wrapped the essential calls to the Sync API. Thanks Pieter. (Update: the original pre-Sync 1.5 code is no longer around, and he eventually updated the wrapper to support the authentication changes in version 1.5 of the Sync service, which corresponded to the release for Firefox 30).

My goal for the front end of my app was to mimic the Firefox Home UI as much as possible. Initially I figured I would do most of the processing on the server then simply use JQuery Mobile to make the UI mobile-friendly. But there was more to it than that.