4

I'm trying to understand how an app like 1Password can be on the Mac App Store and come with a Safari extension (and most importantly, how can the extension communicate with the app) because I'd like to do the same. Is the native app running a server as a subprocess that get's called by the safari extension?

I'd like to know if it's possible to do that and still be Mac App Store + Sandboxing friendly.

Remy Vanherweghem
  • 3,925
  • 1
  • 32
  • 43

2 Answers2

4

1Password uses an agent to communicate between the Mac App and the Safari Extension. The agent is most likely a small server process that can receive RESTful calls from the extension(s). This mechanism allows the synchronization between all the different extensions (Safari, Chrome, Firefox, etc), the client and the main database.

The Safari extension is no longer installed directly by the 1Password app, by the way. Instead, you are directed to a web page that contains the Safari extension download, thus making the App sandbox-friendly.

JavaGeek
  • 76
  • 1
0

I believe it's a regular .app that has a Safari extension inside it as a resource.

The app will check for the existence of the Safari extension on application launch, and if it doesn't find it in the default locations it will prompt the user to install it. If the users chooses to install it, the app copies the extensions to the Safari extensions folder.

Alex
  • 9,313
  • 1
  • 39
  • 44
  • Yes, that I get, but how do they communicate? And that's definitely not acceptable anymore now that we must sandbox our apps. – Remy Vanherweghem Sep 28 '11 at 20:42
  • Ah sorry, the question wasn't clear to me in that respect. The Safari docs are reasonably clear on what an extension can do. In fact, Safari extensions are folders if I remember correctly, so you should be able to check out the source. – Alex Sep 28 '11 at 20:46