On June 1, Apple will enforce Sandboxing for all new apps on the Mac App Store. It has been already widely discussed how this will affect developers and especially certain types of apps. Not least Utility apps which need to have a wide file system access or which are a kind of system service without a real user interface will have hard times making it in the Mac App Store now. I found it a fascinating idea to start a new programming project with exactly this kind of app in mind, just for the reason of testing the limits of how far one can go inside the sandbox. And for the reason that my two existing apps still need to be migrated to the sandbox.

The Challenges

This proved to be a twofold challenge. First, from the programming side. Though there are ‘legal’ possibilities to go outside the sandbox, the new sandbox APIs and methods are still somewhat buggy and not always well-documented, and there’s not much sample code available at the moment. Second, from the user experience side. How will it be possible to create a sandboxed app that needs to access the file system without making it difficult for the user to understand what is going on and to agree to it? What will Apple think of such approaches and will it allow them in the Mac App Store?

The Problem

To explore these challenges, I chose to work on a very small programming project. It should provide a solution for a single, simple, small problem I always had and for which I do not know of any app providing a solution: Bringing Mozilla Firefox and Google Chrome bookmarks to Spotlight. While Spotlight readily indexes Safari bookmarks, there are no convenient approaches to sync Firefox and Chrome bookmarks. Well, you could say, why should one need to do this? If you bookmark a page in Chrome, go to Chrome to open it? If you have bookmarked it in Firefox, open Firefox?

This is surely true, but what if you don’t like looking in these browser’s bookmark lists forever in order to find that bookmark again? What if you use this browser today, that browser tomorrow and don’t like to try to remember where you’ve saved that bookmark again? I admit that I fit into this description.

The Solution

It was like an adventure trip to figure out how to combine sandboxing with good user experience and a clean user interface. And of course how to make Firefox and Chrome bookmarks accessible to Spotlight. What I’ve come up with is Brow – a tiny tool syncing Firefox and Chrome bookmarks with Spotlight. Obviously, as it is a kind of service running in the background it doesn’t really need a user interface (which is the best kind of user interface). However, to comply with the Mac App Store rules, it needs some interface. It needs user consent to access file locations out of the app sandbox, this also calls for at least a minimal user interface. At the moment, Brow looks like this:

Brow main window

This window is all Brow got to present itself to the user, and the idea is that the user needs to have it open exactly once. After Brow has been configured, it will silently run in the background, syncing Chrome and Firefox bookmarks with Spotlight and by this also to all apps building upon Spotlight, like Alfred.

While Brow’s code is more or less complete (it is actually working!), I’ll polish it for some more days before submitting it to Apple in early June. I will then see what they think of it. While I stuck to all Mac App Store and sandboxing rules and while I’m confident Brow will pass the review, one never can tell. I will keep you updated on the development of Brow and will also post some of the techniques I used to marry sandboxing with going beyond the sandbox. If you would like to have an app like Brow, please let me know!