你可以按照这里的文档https://developer.mozilla.org/zh-CN/docs/Web/Events/popstate监听popstate事件。当点击后退按钮、调用history.back()等情况时,应该会触发此事件。