Jeremy Selier

Preview URLs in the new Twitter: there’s a Chrome extension for that!

If you've used the iPad version of Twitter, you probably love the preview of websites within the app. Well, me too, that's why I decided to try to re-create this behavior on the new Twitter.

So I created a Chrome extension called: Twitter Desktop Notification & Preview URLs (I suck at titles). You can install it by going here.

The extension in action

This is a very early implementation. Detected URLs are displayed in the sidebar under the tweet, you can use "p" to view a fullscreen preview of the URL and navigate with the arrow keys if you have multiple URLs in a tweet. I've also added the ability to have Desktop Notifications alerting when New Tweets are received.

I'll probably release the code soon on Github, there's no magic tricks in this code, I'm just using the Linkify library (like Twitter) to find the URLs. The most important part is probably the use of the sandbox attribute for the iframe element to prevent access to the main document. As I’m not really a pro regarding Javascript, I probably made some things wrong. But as soon as the code will be on Github, people will probably help so that's OK!

There's probably some bugs, feel free to contact me via Buzz or Twitter and I'll try to fix them as soon as possible.

Hope you enjoy it!

And thanks Romain Huet for some Javascript Ninja tips!

Archives

Disclaimer: What I write here does not represent the opinions of my employer’s past, present and future.