们在从一个网站点击链接进入另一个页面时,浏览器会在header里加上Referer
值,来标识这次访问的来源页面。但是这种标识有可能会泄漏用户的隐私,有时候我不想让其他人知道我是从哪里点击进来的,能否有手段可以让浏览器不要发送Referer
呢?
我试过用window.location.href='...'
来跳转,也还是有Referer
。大家有什么好办法吗?
function open_without_referrer(link){
document.body.appendChild(document.createElement('iframe')).src='javascript:"<script>top.location.replace(\''+link+'\')<\/script>"';
}
如果如果是新窗口打开,可以使用如下代码:
function open_new_window(full_link){
window.open('javascript:window.name;', '<script>location.replace("'+full_link+'")<\/script>');
}
如果如果是新窗口打开,可以使用如下代码: function open_new_window(full_link){ window.open('javascript:window.name;', '<script>location.replace("'+full_link+'")<\/script>'); }
function open_without_referrer(link){
document.body.appendChild(document.createElement('iframe')).src='javascript:"<script>top.location.replace(\''+link+'\')<\/script>"';
}
if(typeof(parent.window.gotoUrl) == "undefined"){
var referrer = document.referrer;
open_without_referrer(window.location.href);
}