Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

javascript - Stop link from sending referrer to destination

I have a page where I don't want the outbound links to send a referrer so the destination site doesn't know where they came from.

I'm guessing this isn't possible but I just want to make sure there weren't any hidden javascript magic that could do it and that would work with some (if not most) browsers.

Maybe some clever HTTP status code redirecting kung-fu?

Something like this would be perfect

<a href="example.com" send_referrer="false">link</a>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I was looking for just the same thing, and it seems like this will be a feature of HTML5.

The tag you are looking for is rel="noreferrer".

It is already implemented in Webkit (Chrome, etc.), as well as Firefox, but your mileage may vary.

As of 2020, it is supported in all major browsers, with the exception of Opera Mini and old versions of IE11.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...