Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Follow link without sending referrer.
//= 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