防止浏览器回退

//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL)
})
posted @ 2022-06-20 18:52  星云惊蛰  阅读(38)  评论(0)    收藏  举报