Safari Extension to open Twitter.app from OS X Notifications Center


One of the things that bug the crap out of me is when you click an OS X notification of a tweet in notification center, it opens up twitter.com in Safari. I usually use the Twitter.app desktop client, and it is disorienting and inconvenient to get notified of a tweet, and then be prompted authenticate to the twitter website. Here is the flow of the problem:

I create a sweet tweet in Twitter.app:


And I hit send. I then start doing other things, like Xcode or Mail. Then someone responds:


I think that is a cool response, so I click the notification. BOOM! I get this in Safari:


WHAT? WHO? I expected to it to go to Twitter.app since that is where I started the sandwich conversation.

It was low level irritation, and then I saw this on Daringfirball:


Now, if only they would let Apple open this app instead of the twitter.com website when you get notifications through OS X’s built-in Twitter support.

I would love that! For me, it would be good enough if it just opened the twitter app, since it would pretty much be near where I want. So I wondered if Twitter.app had a URL handler, and entering in twitter:// in Safari opened up Twitter.app.

AHA! I could now write an safari extension to see if I was going to a twitter.com address, and then open a twitter:// URL. I’m pretty good at Objective-C, but not so much javascript. Our web guy gave me this:


And then I created a Safari Extension and put it on github:


and now when safari loads up a https://twitter.com URL, the page finishes loading, and the Twitter.app opens (or comes to the front). Same for notification center. Not perfect, but better.

Download it here:

Twitter Launcher