Case:
My question: Is there any way to track the referrer of a new window which was opened using target="_blank"
or Javascript window.open()
function?
If yes then is there any way to completely hide the referrer?
Referrer is in the HTTP header and so it will be available regardless of whether the window is blank or new. You can get the URL with:
console.log(document.referrer);
There are sites that use this to protect their sites from things like click-jacks, so it would be inappropriate to hide the referrer from the linked page. Browsers that allow for referrer spoofing are considered unsafe, and it tends to be patched when found.
Maybe it's not as frowned upon as I thought. HTML5 has a property for <a>
to not send the referrer in the HTTP headers: rel = "noreferrer"
.