More information about the Underscore mailing list

[_] Twitter and Facebook links best practise

Craig Francis craig at
Wed Aug 21 12:17:21 BST 2013

On 21 Aug 2013, at 09:52, simon mosse <simon at> wrote:
> I am ideally hoping to code in one nicely marked up link for both twitter
> and facebook, that will allow the most number of native apps cross-device
> to pick it up and fire open themselves, whilst leaving browsers to pick up
> the link to the web app where no App exists.

Thoughts in progress...

Start with a simple:

    <a href="">Link</a>

This works with every browser, requires no JavaScript, and does not need to load additional external resources... a massive performance gain on websites, where the DNS lookup and the typical request to get the JS, images (and possibly CSS / HTML for the iframe versions), can really slow down your page load time (or block the page loading completely if those resources can't be loaded responsibly).

Then there is the "fb://" protocol used on the iPhone:

That might be able to load the native app... however its really intended for native apps only:

But does still seem to work in Safari, if it was a little slow to load the app (although that might be because I haven't used it for a few months):

Having said that, it does not seem to be that much of a standard... so could break in the future (e.g. fb://page/ appears to have changed to fb://profile/).

So if you want to go that route, then add some JavaScript (ideally from your local domain, or a cookie-less domain), that can just handle the onclick event:

But this is only for iOS... there is also Android:

And dare I say it, Windows/Blackberry/Nokia/etc.

Or just give up and add the Facebook tax, and then allow your pages to join the average page weight of 1MB, and 7 seconds loading time (which can be much longer on mobile):

Enjoy :-)