Question

I want to ask a quetion about rel property of a tag in HTML (actually, HTML5 if that will make any difference)

I'll continue with example domain names. My website is example.com. I've a link to this page at example2.com. If I give this link with something like

<a href="example.com" referrer="referrer.com">Click me</a>

will my referrer be referrer.com or example2.com? BTW is there anything possible like that code? Giving a random referrer?

2nd one, because I think subjects are similar.

  • Is it possible to hide referrer URL?
  • If it's, what will be shown as referrer (in statistics programs or browser)?

Long story short, I want to hide and/or change the referrer.

Was it helpful?

Solution 2

I believe that a meta refresh does not leave a trace of a referrer <meta http-equiv="refresh" content="0; url=http://www.example.com"> The thing here though, is getting it from an onclick (a) element, so you should, AFAIK, be able to do something like:

<a onclick="mask('http://www.example.com/')">Click me</a>

function mask(url) {
    var meta = document.createElement("meta");
    meta.setAttribute("http-equiv", "refresh");
    meta.setAttribute("content", "0; url=" + url);
}

Disclaimer: untested

OTHER TIPS

In HTML5, the link type noreferrer (link to W3C HTML5 CR) can be used:

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.

Example use:

<a href="http://example.com/" rel="noreferrer">Click me</a>

Note: This link type is not part of W3C’s Recommendations of HTML5 and HTML 5.1, but it’s part of WHATWG’s HTML Living standard: Link type "noreferrer".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top