Posted on Thu 15 March 2012

Better privacy with 2-click social buttons

Today I noticed that the social network buttons on my blog had disappeared - I quickly realized that this was because I had recently reset my theme. Of course, I had to bring those buttons back, but better. By chance, I stumbled over the socialshareprivacy projectcache (sorry, german only. project site with downloadscache) of german news site and publisher heise.

I was intrigued. Not only because this would mean better privacy, but also because of another welcome side effect: Faster page load times! After all, if we only load those buttons and their .js and .css files when we need them, we can save up to then requests. However, heise's project still uses a custom javascript library to place the buttons and relies on jQuery - overhead that I wanted to avoid. So I rewrote the code to only use static HTML and inline javascript. You can see the result at the bottom of each post here, or in this gistcache (the gist also has the .css file).

It's really simple: We have an ulist of our buttons. At the beginnig, we just show a greyed out image for each one. If you click it, it's replaced by the real button. I've also added HackerNews and Reddit buttons - the original only contains Facebook, Google+ and Twitter. Hope you like it :)

Category: misc

Tags: web, privacy

© Julian Schrittwieser. Built using Pelican. Theme by Giulio Fidente on github. .