Subscribe:   RSS icon   twitter icon

Bookmarklet to Hide Referrer

Lee Phillips — June 20, 2011

I recently found out that webkit browsers (Safari, Chrome) respect the . This means that when you click on such a link that the browser will abstain from telling your destination page the address of your origin page. Usually you don’t care, but now and then you do. Especially if you don’t trust your destination page and don’t want it to know where you found it.

This opens up a convenient way to hide this referrer information. You merely need to edit the text of the links on the page to add rel = “noreferrer” to all of them. That might not sound convenient, but you can let a javascript program do the editing for you. Just install the following little bookmarklet, and invoke it next time you want to hide your referrer. It also colors the links that it has rewritten, just to let you know that it worked. Remember that only webkit browsers will respect the noreferrer attribute. You can look at the source to see the tiny javascript program that the bookmarklet runs.

NoReferrer ☜ Drag that to your bookmarks bar.

I tested this using Google’s Chrome browser, and it works. Meaning, no referrer information was transmitted, according to my server logs. Note that if you reload the page or return to it with the back button after following a link, you’ll see that the links are back to their original colors, which warns you that you need to invoke the bookmarklet again.

# Boring Bits Below

I noticed a quirk in the Chrome browser (v. 12.0.742.100) while I was testing this.
I wanted to see the page’s source after invoking the Bookmarklet, but “View Page Source” in Chrome shows you the original loaded source, not the actual source after it has been modified by any scripts. And if you try to save the page as html only, you again get a freshly loaded source. But if you save as “Web Page, Complete”, Chrome saves you a version corresponding to what is currently loaded. There is nothing wrong with this behavior, and is probably what I want when saving local copies of pages, but you need to be aware of it when developing scripts.


Share with Facebook Share with Twitter Share with Reddit Share with StumbleUpon Share with Digg Share with Slashdot
▶ Comment
lee-phillips.org is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.
Quotilizer ... loading ...

Tenuously related:

The best tool for CVs with publication lists.