-
-
Save yasiralijaved/2405377 to your computer and use it in GitHub Desktop.
Bookmarklet to redirect from an article on The Guardian site to The Guardian Facebook app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<a href="javascript:(function () { | |
var host = 'http://www.guardian.co.uk/'; | |
var url = document.location.href; | |
if (url.indexOf(host) == 0) { | |
var dir = url.substring(host.length); | |
var FACEBOOK_GUARDIAN = 'https://apps.facebook.com/theguardian/'; | |
document.location.href = FACEBOOK_GUARDIAN + dir; | |
} | |
}()); ">Read The Guardian in Facebook</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment