SOURCE

//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
  history.pushState(null, null, document.URL);
});
console 命令行工具 X clear

                    
>
console