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?
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.
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:
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.
You might have jQuery write a link with the rel
attribute set to noreferrer
, then call it with $(link_you_made).click()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With