Skip to content

Instantly share code, notes, and snippets.

@bkeepers
Created January 9, 2014 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkeepers/8337479 to your computer and use it in GitHub Desktop.
Save bkeepers/8337479 to your computer and use it in GitHub Desktop.
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