17

I think I saw someday a way to create a link without sending the page that the user was in originally. Is that possible? Or do we need to use a redirector to hide the location of the previous site?

EDIT: If you have an idea for a server-side option to anonymise the link you're welcome.

LuRsT
  • 3,973
  • 9
  • 39
  • 51

6 Answers6

13
<a href="example.com" rel="noreferrer">Example</a>

http://www.w3.org/TR/html5/links.html#link-type-noreferrer The noreferrer keyword may be used with a and area elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

It indicates that no referrer information is to be leaked when following the link.

If a user agent follows a link defined by an a or area element that has the noreferrer keyword, the user agent must not include a Referer (sic) HTTP header (or equivalent for other protocols) in the request.

6

Check out this section on Wiki on referrer hiding.

Most major browsers do not send the referrer header when they are instructed to redirect using the "Refresh" HTTP header. However, this method of redirection is discouraged by the W3C.

gilly3
  • 87,962
  • 25
  • 144
  • 176
Ólafur Waage
  • 68,817
  • 22
  • 142
  • 198
1

I recommend to using a service like https://anon.click/ Also in HTML5 there is the rel="noreferrer" which could be used.

Dweeberly
  • 4,668
  • 2
  • 22
  • 41
pubkey
  • 617
  • 8
  • 17
1

I use a combination of multiple answers I see here.

<a href='data:text/html;charset=utf-8,<html><head><meta http-equiv="refresh" content="0;url=http://www.google.com/"></head><body><a href="http://www.google.com/" rel=noreferrer>Open Link</a></body></html>' rel=noreferrer target=_blank>A link without referer</a>

I tested with Firefox, Chrome, iOS Safari, and Samsung Android default browser. And it works.

Even if a browser sends a referrer, it will not be the website since the page address is "data:...". That's why it is much safer than creating a page that does this.

FlorianB
  • 2,188
  • 18
  • 30
1

There is no way to do this.

In fact this param is controlled on the client side. Depending on the browser, some just never send referer or fakes.

You should not be able to do it in any way.

But here is 2 tips:

  • Use a redirector page
  • Offer to the user a copy/paste function and then, open a new window to let him able to paste and go.
acrosman
  • 12,814
  • 10
  • 39
  • 55
Boris Guéry
  • 47,316
  • 8
  • 52
  • 87
0

Depending on what your circumstances are you could use something like anonym.to - if you trust these services.

From your tag I assume you do not want to use (or have access to) server-side tools like PHP. In that case this will be tricky. I don't know whether this is even possible at all with just HTML/Javascript.

n3rd
  • 5,989
  • 4
  • 39
  • 56