Created
January 9, 2014 16:45
-
-
Save bkeepers/8337479 to your computer and use it in GitHub Desktop.
Follow link without sending referrer.
This file contains 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
//= require lib/jquery | |
//= require csrf | |
function openWithoutReferrer(url) { | |
var site = window.open("", "hide_referrer"); | |
site.document.open(); | |
site.document.writeln('<script type="text/javascript">window.location = "' + url + '";</script>'); | |
site.document.close(); | |
} | |
$('a.noreferrer').live('click', function(e) { | |
e.preventDefault(); | |
openWithoutReferrer(this.href); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment