1. 程式人生 > >讓瀏覽器在訪問鏈接時不要帶上referer

讓瀏覽器在訪問鏈接時不要帶上referer

new pen javascrip frame lac code document end body

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>‘);
 }

讓瀏覽器在訪問鏈接時不要帶上referer