Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open a link in jQuery without the referral information

Tags:

jquery

I need to open a link from within jQuery but i need to avoid sending the referral information. In shorter words, i need to simulate rel="noreferrer"

Is it feasible?

like image 868
Andres SK Avatar asked Mar 16 '10 23:03

Andres SK


3 Answers

A quick solution to do no-referer link open.

function open_link(url)
{
    instance = window.open("about:blank");
    instance.document.write("<meta http-equiv=\"refresh\" content=\"0;url="+url+"\">");
    instance.document.close();
    return false;
}

Tested. Working in FF, IE, Chrome.

like image 176
Ken Shiro Avatar answered Sep 21 '22 10:09

Ken Shiro


I think every browser out there automatically tacks this information onto all requests, and there's no way to directly modify it with JavaScript.

After scouring the web, you do have a couple of options though:

  1. Launch the link from within a Flash application
  2. Launch the link from within a Java applet
  3. Run your URL through a referrer cloaker/spoofer service

All options are ugly and I wouldn't recommend them for usability reasons. I'm basing this off of an old Google Answers question, but I think the answers stand.

like image 20
Cᴏʀʏ Avatar answered Sep 23 '22 10:09

Cᴏʀʏ


You might have jQuery write a link with the rel attribute set to noreferrer, then call it with $(link_you_made).click().

like image 34
sczizzo Avatar answered Sep 21 '22 10:09

sczizzo