1 history.pushState(null, null, document.URL); 2 window.addEventListener('popstate', function () { 3 history.pushState(null, null, document.URL); 4 });
可以禁用包括键盘、鼠标手势等产生的所有后退动作。