使用pushstate,指定回退地址

history.pushState(null,"testname", window.location.href);
    window.addEventListener('popstate', function(evt){
        window.location.replace('http://www.baidu.com')
    }, false);

  

原文地址:https://www.cnblogs.com/mengxingxinqing/p/9046460.html